From 872b960566838c627c5b03ce4a77d43727f94a93 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Wed, 4 Oct 2023 13:19:17 +0200 Subject: [PATCH 1/2] misc: simplify code and change warning to debug --- .../src/authentication_storage/storage.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/rattler_networking/src/authentication_storage/storage.rs b/crates/rattler_networking/src/authentication_storage/storage.rs index a1adbd3fd..c04db3434 100644 --- a/crates/rattler_networking/src/authentication_storage/storage.rs +++ b/crates/rattler_networking/src/authentication_storage/storage.rs @@ -105,17 +105,16 @@ impl AuthenticationStorage { return Ok(None); } Err(e) => { - tracing::warn!( - "Error retrieving credentials for {}: {}, using fallback storage at {}", + tracing::debug!( + "Unable to retrieve credentials for {}: {}, using fallback credential storage at {}", host, e, self.fallback_storage.path.display() ); - let fb_pw = self.fallback_storage.get_password(host)?; - if fb_pw.is_none() { - return Ok(None); + match self.fallback_storage.get_password(host)?{ + None => { return Ok(None) } + Some(password) => {password} } - fb_pw.unwrap() } }; From 7f62cbe8e31fd8e88ff0e7858f034bc3bf2e29da Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Wed, 4 Oct 2023 13:37:31 +0200 Subject: [PATCH 2/2] fmt --- .../src/authentication_storage/storage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/rattler_networking/src/authentication_storage/storage.rs b/crates/rattler_networking/src/authentication_storage/storage.rs index c04db3434..98e6a31c9 100644 --- a/crates/rattler_networking/src/authentication_storage/storage.rs +++ b/crates/rattler_networking/src/authentication_storage/storage.rs @@ -111,9 +111,9 @@ impl AuthenticationStorage { e, self.fallback_storage.path.display() ); - match self.fallback_storage.get_password(host)?{ - None => { return Ok(None) } - Some(password) => {password} + match self.fallback_storage.get_password(host)? { + None => return Ok(None), + Some(password) => password, } } };