Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Aug 25, 2024
1 parent d49fc58 commit 538b5dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions psst-gui/src/data/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -280,4 +280,4 @@ impl Default for SortCriteria {
fn default() -> Self {
Self::DateAdded
}
}
}
3 changes: 1 addition & 2 deletions psst-gui/src/ui/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,11 @@ impl<W: Widget<AppState>> Controller<AppState, W> 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();

Expand Down

0 comments on commit 538b5dc

Please sign in to comment.