Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Oct 28, 2023
1 parent aa90b1f commit ee129b9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions common/src/models/error.rs
Expand Up @@ -215,18 +215,14 @@ pub mod axum {
match axum::extract::Path::<T>::from_request_parts(parts, state).await {
Ok(value) => Ok(Self(value.0)),
Err(rejection) => {
match &rejection {
PathRejection::FailedToDeserializePathParams(inner) => match inner.kind() {
ErrorKind::Message(message) => {
return Err(ApiError {
message: message.clone(),
status_code: StatusCode::BAD_REQUEST.as_u16(),
})
}
_ => (),
},
_ => (),
};
if let PathRejection::FailedToDeserializePathParams(inner) = &rejection {
if let ErrorKind::Message(message) = inner.kind() {
return Err(ApiError {
message: message.clone(),
status_code: StatusCode::BAD_REQUEST.as_u16(),
});
}
}

Err(ApiError {
message: rejection.body_text(),
Expand Down

0 comments on commit ee129b9

Please sign in to comment.