1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-30 00:14:58 +02:00

feat: use PRITIT for FromRequest

This commit is contained in:
Rob Ede
2023-11-17 02:53:32 +00:00
parent fdef224a06
commit 9a4090761c
16 changed files with 160 additions and 459 deletions

View File

@ -3,7 +3,6 @@ use std::{
str::FromStr,
};
use actix_utils::future::{ready, Ready};
use actix_web::{dev::Payload, FromRequest, HttpRequest};
use crate::error::UriSegmentError;
@ -88,10 +87,10 @@ impl AsRef<Path> for PathBufWrap {
impl FromRequest for PathBufWrap {
type Error = UriSegmentError;
type Future = Ready<Result<Self, Self::Error>>;
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
ready(req.match_info().unprocessed().parse())
#[inline]
async fn from_request(req: &HttpRequest, _: &mut Payload) -> Result<Self, Self::Error> {
req.match_info().unprocessed().parse()
}
}