mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 05:07:40 +02:00
Change String
to &str
for all Rocket functions
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
This commit is contained in:
@ -231,7 +231,7 @@ impl<'r> FromParam<'r> for SafeString {
|
||||
|
||||
// Log all the routes from the main paths list, and the attachments endpoint
|
||||
// Effectively ignores, any static file route, and the alive endpoint
|
||||
const LOGGED_ROUTES: [&str; 5] = ["/api", "/admin", "/identity", "/icons", "/attachments"];
|
||||
const LOGGED_ROUTES: [&str; 7] = ["/api", "/admin", "/identity", "/icons", "/attachments", "/events", "/notifications"];
|
||||
|
||||
// Boolean is extra debug, when true, we ignore the whitelist above and also print the mounts
|
||||
pub struct BetterLogging(pub bool);
|
||||
@ -248,7 +248,7 @@ impl Fairing for BetterLogging {
|
||||
if self.0 {
|
||||
info!(target: "routes", "Routes loaded:");
|
||||
let mut routes: Vec<_> = rocket.routes().collect();
|
||||
routes.sort_by_key(|r| r.uri.path());
|
||||
routes.sort_by_key(|r| r.uri.path().as_str());
|
||||
for route in routes {
|
||||
if route.rank < 0 {
|
||||
info!(target: "routes", "{:<6} {}", route.method, route.uri);
|
||||
|
Reference in New Issue
Block a user