Run into_parts eagerly in more places

This commit is contained in:
Jonas Platte
2025-03-28 09:35:21 +01:00
committed by Jonas Platte
parent ee4727b865
commit 2f2bb99550
8 changed files with 24 additions and 21 deletions
+5 -2
View File
@@ -101,9 +101,12 @@ where
{
type Rejection = <Self as FromRequestParts<S>>::Rejection;
async fn from_request(req: Request, state: &S) -> Result<Self, Self::Rejection> {
fn from_request(
req: Request,
state: &S,
) -> impl Future<Output = Result<Self, Self::Rejection>> {
let (mut parts, _) = req.into_parts();
Self::from_request_parts(&mut parts, state).await
async move { Self::from_request_parts(&mut parts, state).await }
}
}