mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
ref(axum-extra): Replaced match with ?
This commit is contained in:
@@ -37,9 +37,7 @@ where
|
||||
type Rejection = R;
|
||||
|
||||
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
|
||||
match req.extract::<E>().await {
|
||||
Ok(extractor) => Ok(WithRejection(extractor, PhantomData)),
|
||||
Err(err) => Err(err.into()),
|
||||
}
|
||||
let extractor = req.extract::<E>().await?;
|
||||
Ok(WithRejection(extractor, PhantomData))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user