nah do that instead

This commit is contained in:
Erica Z 2024-11-01 10:22:36 +01:00
parent 66fa21f50f
commit 3923635703

View file

@ -103,12 +103,11 @@ impl Client {
// wrap this logic in a fn so we can use ?
async fn perform<T: serde::de::DeserializeOwned + Send + 'static>(
response: Result<reqwest::Response, reqwest::Error>,
) -> Result<schema::SubsonicResponse<T>, reqwest::Error> {
Ok(response?
) -> Result<schema::SubsonicResponseOuter<T>, reqwest::Error> {
response?
.error_for_status()?
.json::<schema::SubsonicResponseOuter<T>>()
.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),