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 ?
|
||||
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),
|
||||
|
|
Loading…
Reference in a new issue