Skip to content

Commit

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

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

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

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

let Ok(content_type) = Accept::from_request_parts(&mut parts, &state).await;
let content_type = Accept::from_request_parts(&mut parts, &state)
.await
.unwrap();

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

let Ok(content_type) = Accept::from_request_parts(&mut parts, &state).await;
let content_type = Accept::from_request_parts(&mut parts, &state).await.unwrap();

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

0 comments on commit fec47cc

Please sign in to comment.