Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
matteopolak committed Aug 30, 2024
1 parent 2c4df83 commit 4ea9635
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ where

async fn from_request(req: Request, state: &S) -> Result<Self, Self::Rejection> {
let (mut parts, body) = req.into_parts();
let accept = match Accept::from_request_parts(&mut parts, state).await {
Ok(accept) => accept,
Err(rejection) => match rejection {},
};
let Ok(accept) = Accept::from_request_parts(&mut parts, state).await;

let req = Request::from_parts(parts, body);

Expand Down
10 changes: 2 additions & 8 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ where
Box::pin(async move {
let (mut parts, ..) = req.into_parts();

let content_type = match Accept::from_request_parts(&mut parts, &state).await {
Ok(content_type) => content_type,
Err(rejection) => match rejection {},
};
let Ok(content_type) = Accept::from_request_parts(&mut parts, &state).await;

self().await.into_codec_response(content_type.into())
})
Expand All @@ -169,10 +166,7 @@ macro_rules! impl_handler {
Box::pin(async move {
let (mut parts, body) = req.into_parts();

let content_type = match Accept::from_request_parts(&mut parts, &state).await {
Ok(content_type) => content_type,
Err(rejection) => match rejection {},
};
let Ok(content_type) = Accept::from_request_parts(&mut parts, &state).await;

$(
let $ty = match $ty::from_request_parts(&mut parts, &state).await {
Expand Down

0 comments on commit 4ea9635

Please sign in to comment.