ref(axum-extra): Replaced match with ?

This commit is contained in:
Altair-Bueno
2022-08-15 18:03:59 +02:00
parent fbbde39917
commit 9b557c96ca
+2 -4
View File
@@ -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))
}
}