1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-23 11:02:35 +03:00

Apply suggestions from code review

Co-authored-by: Kévin Commaille <76261501+zecakeh@users.noreply.github.com>
This commit is contained in:
Quentin Gliech
2022-08-19 10:07:15 +02:00
parent 185ff622f9
commit 95eba8f88b
3 changed files with 9 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ pub enum Error<Service> {
Service { inner: Service },
#[error("could not parse JSON payload")]
Serialize {
Deserialize {
#[source]
inner: serde_json::Error,
},
@@ -38,8 +38,8 @@ impl<S> Error<S> {
Self::Service { inner: source }
}
fn serialize(source: serde_json::Error) -> Self {
Self::Serialize { inner: source }
fn deserialize(source: serde_json::Error) -> Self {
Self::Deserialize { inner: source }
}
}
@@ -85,7 +85,7 @@ where
let response = res.map_err(Error::service)?;
let (parts, body) = response.into_parts();
let body = serde_json::from_reader(body.reader()).map_err(Error::serialize)?;
let body = serde_json::from_reader(body.reader()).map_err(Error::deserialize)?;
let res = Response::from_parts(parts, body);
Ok(res)