From 4bdd6a51485c09ce0e8f0e55a76a818a66b51cbf Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Tue, 18 Jan 2022 13:48:21 +0100 Subject: [PATCH] clippy fixes Signed-off-by: Fabian Ebner Signed-off-by: Wolfgang Bumiller --- src/config.rs | 4 ++-- src/repositories/repository.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index aac8bc5c..fcb66cbb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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) } diff --git a/src/repositories/repository.rs b/src/repositories/repository.rs index 05b98ddd..4c87f11b 100644 --- a/src/repositories/repository.rs +++ b/src/repositories/repository.rs @@ -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('/') {