diff --git a/src/subsonic.rs b/src/subsonic.rs index 8c0d36e..a05ed52 100644 --- a/src/subsonic.rs +++ b/src/subsonic.rs @@ -103,12 +103,11 @@ impl Client { // wrap this logic in a fn so we can use ? async fn perform( response: Result, - ) -> Result, reqwest::Error> { - Ok(response? + ) -> Result, reqwest::Error> { + response? .error_for_status()? .json::>() - .await? - .subsonic_response) + .await } sender @@ -120,7 +119,8 @@ impl Client { let response = receiver .recv() .await - .expect("could not receive subsonic response from tokio")?; + .expect("could not receive subsonic response from tokio")? + .subsonic_response; match response { schema::SubsonicResponse::Ok { inner } => Ok(inner),