[pve-devel] [PATCH proxmox-apt 2/3] clippy fixes

Fabian Ebner f.ebner at proxmox.com
Tue Jan 18 13:48:21 CET 2022


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 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 aac8bc5..fcb66cb 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 05b98dd..4c87f11 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('/') {
-- 
2.30.2





More information about the pve-devel mailing list