From 538b5dcc418f638142e159b57864b9f31c79b7ad Mon Sep 17 00:00:00 2001 From: Jackson Goode Date: Sun, 25 Aug 2024 02:40:20 -0700 Subject: [PATCH] Linting --- psst-gui/src/data/config.rs | 4 ++-- psst-gui/src/ui/preferences.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/psst-gui/src/data/config.rs b/psst-gui/src/data/config.rs index 08c2aea5..7c21b1d2 100644 --- a/psst-gui/src/data/config.rs +++ b/psst-gui/src/data/config.rs @@ -191,7 +191,7 @@ impl Config { pub fn username(&self) -> Option<&str> { self.credentials .as_ref() - .map_or(None, |c| c.username.as_deref()) + .and_then(|c| c.username.as_deref()) } pub fn session(&self) -> SessionConfig { @@ -280,4 +280,4 @@ impl Default for SortCriteria { fn default() -> Self { Self::DateAdded } -} +} \ No newline at end of file diff --git a/psst-gui/src/ui/preferences.rs b/psst-gui/src/ui/preferences.rs index ec87e00c..d9c5d403 100644 --- a/psst-gui/src/ui/preferences.rs +++ b/psst-gui/src/ui/preferences.rs @@ -372,12 +372,11 @@ impl> Controller for Authenticate { let result = cmd .get_unchecked(Self::RESPONSE) .to_owned() - .and_then(|credentials| { + .map(|credentials| { let username = credentials.username.clone().unwrap_or_default(); WebApi::global().load_local_tracks(&username); data.config.store_credentials(credentials); data.config.save(); - Ok(()) }); let is_ok = result.is_ok();