diff --git a/src/subsonic.rs b/src/subsonic.rs index d7b09b1..92fb7de 100644 --- a/src/subsonic.rs +++ b/src/subsonic.rs @@ -30,6 +30,16 @@ impl fmt::Display for Error { } } +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Self::UrlParseError(err) => err.source(), + Self::ReqwestError(err) => err.source(), + _ => None, + } + } +} + impl From for Error { fn from(err: reqwest::Error) -> Self { // don't print secret salt/token combo diff --git a/src/ui/setup.rs b/src/ui/setup.rs index 1b078f1..71662a7 100644 --- a/src/ui/setup.rs +++ b/src/ui/setup.rs @@ -88,7 +88,7 @@ mod imp { match api.ping().await { Ok(()) => { self.obj().set_status("Connected"); - self.save_async().await; + self.save().await; // please REMOVEME once we've killed vala fn get_random_salt(length: usize) -> String { @@ -126,7 +126,7 @@ mod imp { self.obj().set_authn_can_edit(true); } - async fn save_async(&self) { + async fn save(&self) { self.obj().set_authn_can_edit(false); // TODO remove unwraps etc etc