clippy fixes

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Fabian Ebner 2022-01-18 13:48:21 +01:00 committed by Wolfgang Bumiller
parent 9caae7d49e
commit 4bdd6a5148
2 changed files with 3 additions and 3 deletions

View File

@ -24,12 +24,12 @@ impl APTConfig {
///
/// Initializes with default values if init() wasn't called before.
pub fn get() -> &'static APTConfig {
&GLOBAL_CONFIG.get_or_init(|| APTConfig::new(None, None))
GLOBAL_CONFIG.get_or_init(|| APTConfig::new(None, None))
}
/// Initialize the configuration.
///
/// Only has an effect if no init() or get() has been called yet.
pub fn init(config: APTConfig) -> &'static APTConfig {
&GLOBAL_CONFIG.get_or_init(|| config)
GLOBAL_CONFIG.get_or_init(|| config)
}

View File

@ -409,7 +409,7 @@ fn uri_to_filename(uri: &str) -> String {
/// Get the host part from a given URI.
fn host_from_uri(uri: &str) -> Option<&str> {
let host = uri.strip_prefix("http")?;
let host = host.strip_prefix("s").unwrap_or(host);
let host = host.strip_prefix('s').unwrap_or(host);
let mut host = host.strip_prefix("://")?;
if let Some(end) = host.find('/') {