diff --git a/src/api/admin.rs b/src/api/admin.rs index 803fa39a..f8b83581 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -99,7 +99,7 @@ const BASE_TEMPLATE: &str = "admin/base"; const ACTING_ADMIN_USER: &str = "vaultwarden-admin-00000-000000000000"; fn admin_path() -> String { - format!("{}", ADMIN_PATH) + ADMIN_PATH.to_string() } #[derive(Debug)] diff --git a/src/api/core/two_factor/webauthn.rs b/src/api/core/two_factor/webauthn.rs index bf1460b8..2f8efaab 100644 --- a/src/api/core/two_factor/webauthn.rs +++ b/src/api/core/two_factor/webauthn.rs @@ -54,9 +54,9 @@ struct WebauthnConfig { impl WebauthnConfig { fn load(domain: &str, domain_origin: &str) -> Webauthn { Webauthn::new(Self { - rpid: Url::parse(&domain).map(|u| u.domain().map(str::to_owned)).ok().flatten().unwrap_or_default(), + rpid: Url::parse(domain).map(|u| u.domain().map(str::to_owned)).ok().flatten().unwrap_or_default(), url: domain.to_string(), - origin: Url::parse(&domain_origin).unwrap(), + origin: Url::parse(domain_origin).unwrap(), }) } } diff --git a/src/api/web.rs b/src/api/web.rs index 5f4c961d..1920d749 100644 --- a/src/api/web.rs +++ b/src/api/web.rs @@ -6,7 +6,6 @@ use serde_json::Value; use crate::{ api::{core::now, ApiResult, EmptyResult}, auth::{decode_file_download, HostInfo}, - config::extract_url_host, error::Error, util::{Cached, SafeString}, CONFIG, diff --git a/src/config.rs b/src/config.rs index 791668b1..0a9f80d6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -436,7 +436,7 @@ make_config! { domain_set: bool, false, def, false; /// Domain path |> Domain URL path (in https://example.com:8443/path, /path is the path) /// MUST be the same for all domains. - domain_path: String, false, auto, |c| extract_url_path(&c.domain_change_back.split(',').nth(0).expect("Missing domain")); + domain_path: String, false, auto, |c| extract_url_path(c.domain_change_back.split(',').next().expect("Missing domain")); /// Enable web vault web_vault_enabled: bool, false, def, true; @@ -1301,7 +1301,7 @@ impl Config { (extract_url_host(d), extract_url_origin(d)) }) .collect() - }).get(host).map(|h| h.clone()) + }).get(host).cloned() } pub fn host_to_domain(&self, host: &str) -> Option { @@ -1314,7 +1314,7 @@ impl Config { (extract_url_host(d), extract_url_path(d)) }) .collect() - }).get(host).map(|h| h.clone()) + }).get(host).cloned() } // Yes this is a base_url