nah do that instead
This commit is contained in:
parent
66fa21f50f
commit
3923635703
1 changed files with 5 additions and 5 deletions
|
@ -103,12 +103,11 @@ impl Client {
|
||||||
// wrap this logic in a fn so we can use ?
|
// wrap this logic in a fn so we can use ?
|
||||||
async fn perform<T: serde::de::DeserializeOwned + Send + 'static>(
|
async fn perform<T: serde::de::DeserializeOwned + Send + 'static>(
|
||||||
response: Result<reqwest::Response, reqwest::Error>,
|
response: Result<reqwest::Response, reqwest::Error>,
|
||||||
) -> Result<schema::SubsonicResponse<T>, reqwest::Error> {
|
) -> Result<schema::SubsonicResponseOuter<T>, reqwest::Error> {
|
||||||
Ok(response?
|
response?
|
||||||
.error_for_status()?
|
.error_for_status()?
|
||||||
.json::<schema::SubsonicResponseOuter<T>>()
|
.json::<schema::SubsonicResponseOuter<T>>()
|
||||||
.await?
|
.await
|
||||||
.subsonic_response)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sender
|
sender
|
||||||
|
@ -120,7 +119,8 @@ impl Client {
|
||||||
let response = receiver
|
let response = receiver
|
||||||
.recv()
|
.recv()
|
||||||
.await
|
.await
|
||||||
.expect("could not receive subsonic response from tokio")?;
|
.expect("could not receive subsonic response from tokio")?
|
||||||
|
.subsonic_response;
|
||||||
|
|
||||||
match response {
|
match response {
|
||||||
schema::SubsonicResponse::Ok { inner } => Ok(inner),
|
schema::SubsonicResponse::Ok { inner } => Ok(inner),
|
||||||
|
|
Loading…
Reference in a new issue