1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-16 04:12:53 +01:00

make clippy happy

Dieser Commit ist enthalten in:
BlockListed 2023-09-09 14:59:20 +02:00
Ursprung f20863096f
Commit c0db0d8da0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 2D204777C477B588
4 geänderte Dateien mit 6 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -99,7 +99,7 @@ const BASE_TEMPLATE: &str = "admin/base";
const ACTING_ADMIN_USER: &str = "vaultwarden-admin-00000-000000000000"; const ACTING_ADMIN_USER: &str = "vaultwarden-admin-00000-000000000000";
fn admin_path() -> String { fn admin_path() -> String {
format!("{}", ADMIN_PATH) ADMIN_PATH.to_string()
} }
#[derive(Debug)] #[derive(Debug)]

Datei anzeigen

@ -54,9 +54,9 @@ struct WebauthnConfig {
impl WebauthnConfig { impl WebauthnConfig {
fn load(domain: &str, domain_origin: &str) -> Webauthn<Self> { fn load(domain: &str, domain_origin: &str) -> Webauthn<Self> {
Webauthn::new(Self { 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(), url: domain.to_string(),
origin: Url::parse(&domain_origin).unwrap(), origin: Url::parse(domain_origin).unwrap(),
}) })
} }
} }

Datei anzeigen

@ -6,7 +6,6 @@ use serde_json::Value;
use crate::{ use crate::{
api::{core::now, ApiResult, EmptyResult}, api::{core::now, ApiResult, EmptyResult},
auth::{decode_file_download, HostInfo}, auth::{decode_file_download, HostInfo},
config::extract_url_host,
error::Error, error::Error,
util::{Cached, SafeString}, util::{Cached, SafeString},
CONFIG, CONFIG,

Datei anzeigen

@ -436,7 +436,7 @@ make_config! {
domain_set: bool, false, def, false; domain_set: bool, false, def, false;
/// Domain path |> Domain URL path (in https://example.com:8443/path, /path is the path) /// Domain path |> Domain URL path (in https://example.com:8443/path, /path is the path)
/// MUST be the same for all domains. /// 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 /// Enable web vault
web_vault_enabled: bool, false, def, true; web_vault_enabled: bool, false, def, true;
@ -1301,7 +1301,7 @@ impl Config {
(extract_url_host(d), extract_url_origin(d)) (extract_url_host(d), extract_url_origin(d))
}) })
.collect() .collect()
}).get(host).map(|h| h.clone()) }).get(host).cloned()
} }
pub fn host_to_domain(&self, host: &str) -> Option<String> { pub fn host_to_domain(&self, host: &str) -> Option<String> {
@ -1314,7 +1314,7 @@ impl Config {
(extract_url_host(d), extract_url_path(d)) (extract_url_host(d), extract_url_path(d))
}) })
.collect() .collect()
}).get(host).map(|h| h.clone()) }).get(host).cloned()
} }
// Yes this is a base_url // Yes this is a base_url