1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-21 23:00:50 +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

@@ -32,7 +32,7 @@ pub enum Error<Service> {
Service { inner: Service },
#[error("could not serialize JSON payload")]
Json {
Serialize {
#[source]
inner: serde_json::Error,
},
@@ -43,8 +43,8 @@ impl<S> Error<S> {
Self::Service { inner: source }
}
fn json(source: serde_json::Error) -> Self {
Self::Json { inner: source }
fn serialize(source: serde_json::Error) -> Self {
Self::Serialize { inner: source }
}
}
@@ -88,7 +88,7 @@ where
let body = match serde_json::to_vec(&body) {
Ok(body) => Full::new(Bytes::from(body)),
Err(err) => return std::future::ready(Err(Error::json(err))).left_future(),
Err(err) => return std::future::ready(Err(Error::serialize(err))).left_future(),
};
let request = Request::from_parts(parts, body);