From 9b557c96ca8567787d9609a27e62d72bec762c99 Mon Sep 17 00:00:00 2001 From: Altair-Bueno <67512202+Altair-Bueno@users.noreply.github.com> Date: Mon, 15 Aug 2022 18:03:59 +0200 Subject: [PATCH] ref(axum-extra): Replaced `match` with `?` --- axum-extra/src/extract/with_rejection.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/axum-extra/src/extract/with_rejection.rs b/axum-extra/src/extract/with_rejection.rs index 0b20641f..586afa5f 100644 --- a/axum-extra/src/extract/with_rejection.rs +++ b/axum-extra/src/extract/with_rejection.rs @@ -37,9 +37,7 @@ where type Rejection = R; async fn from_request(req: &mut RequestParts) -> Result { - match req.extract::().await { - Ok(extractor) => Ok(WithRejection(extractor, PhantomData)), - Err(err) => Err(err.into()), - } + let extractor = req.extract::().await?; + Ok(WithRejection(extractor, PhantomData)) } }