[PR #3491] [MERGED] Change String to &str for all Rocket functions and some other fixes #3294

Closed
opened 2026-03-03 09:58:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3491
Author: @BlackDex
Created: 4/30/2023
Status: Merged
Merged: 4/30/2023
Merged by: @dani-garcia

Base: mainHead: rocket_changes


📝 Commits (3)

  • 18abf22 Fix admin post endpoints
  • 951ba55 Prevent some ::_ logs from outputting
  • f906f62 Change String to &str for all Rocket functions

📊 Changes

19 files changed (+522 additions, -527 deletions)

View changed files

📝 Cargo.lock (+48 -48)
📝 Cargo.toml (+9 -9)
📝 src/api/admin.rs (+21 -21)
📝 src/api/core/accounts.rs (+7 -7)
📝 src/api/core/ciphers.rs (+71 -70)
📝 src/api/core/emergency_access.rs (+40 -48)
📝 src/api/core/events.rs (+13 -13)
📝 src/api/core/folders.rs (+8 -8)
📝 src/api/core/mod.rs (+3 -3)
📝 src/api/core/organizations.rs (+236 -241)
📝 src/api/core/sends.rs (+21 -21)
📝 src/api/icons.rs (+5 -5)
📝 src/api/web.rs (+2 -2)
📝 src/auth.rs (+24 -22)
📝 src/mail.rs (+2 -2)
📝 src/main.rs (+7 -2)
📝 src/static/scripts/admin_settings.js (+2 -2)
📝 src/static/scripts/admin_users.js (+1 -1)
📝 src/util.rs (+2 -2)

📄 Description

During setting the latest commit hash for Rocket and updating all the other crates, there were some messages regarding the usage of String for the Rocket endpoint function calls.
I acted upon this message and changed all String types to &str and modified the code where needed.

This ended up in less alloc calls, and probably also a bit less memory usage.

  • Updated all the crates and commit hashes
  • Modified all String to &str where applicable
  • Prevent some ::_ logs from outputting
  • Added some extra routes to be logged
  • Fix some admin post endpoints

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3491 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 4/30/2023 **Status:** ✅ Merged **Merged:** 4/30/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `rocket_changes` --- ### 📝 Commits (3) - [`18abf22`](https://github.com/dani-garcia/vaultwarden/commit/18abf226bee7675a97432050882ed8299d6c64ab) Fix admin post endpoints - [`951ba55`](https://github.com/dani-garcia/vaultwarden/commit/951ba5512330d34b633a5e6692935c594b40575a) Prevent some `::_` logs from outputting - [`f906f62`](https://github.com/dani-garcia/vaultwarden/commit/f906f6230a8308a3b60d0bac49f99244b7c89df9) Change `String` to `&str` for all Rocket functions ### 📊 Changes **19 files changed** (+522 additions, -527 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+48 -48) 📝 `Cargo.toml` (+9 -9) 📝 `src/api/admin.rs` (+21 -21) 📝 `src/api/core/accounts.rs` (+7 -7) 📝 `src/api/core/ciphers.rs` (+71 -70) 📝 `src/api/core/emergency_access.rs` (+40 -48) 📝 `src/api/core/events.rs` (+13 -13) 📝 `src/api/core/folders.rs` (+8 -8) 📝 `src/api/core/mod.rs` (+3 -3) 📝 `src/api/core/organizations.rs` (+236 -241) 📝 `src/api/core/sends.rs` (+21 -21) 📝 `src/api/icons.rs` (+5 -5) 📝 `src/api/web.rs` (+2 -2) 📝 `src/auth.rs` (+24 -22) 📝 `src/mail.rs` (+2 -2) 📝 `src/main.rs` (+7 -2) 📝 `src/static/scripts/admin_settings.js` (+2 -2) 📝 `src/static/scripts/admin_users.js` (+1 -1) 📝 `src/util.rs` (+2 -2) </details> ### 📄 Description During setting the latest commit hash for Rocket and updating all the other crates, there were some messages regarding the usage of `String` for the Rocket endpoint function calls. I acted upon this message and changed all `String` types to `&str` and modified the code where needed. This ended up in less `alloc` calls, and probably also a bit less memory usage. - Updated all the crates and commit hashes - Modified all `String` to `&str` where applicable - Prevent some `::_` logs from outputting - Added some extra routes to be logged - Fix some admin post endpoints --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:58:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3294
No description provided.