1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

refactor FromRequest trait

This commit is contained in:
Nikolay Kim
2019-04-07 14:43:07 -07:00
parent 3c650ca194
commit 75b213a6f0
18 changed files with 298 additions and 352 deletions

View File

@ -10,8 +10,8 @@ use std::{cmp, io};
use actix_service::boxed::{self, BoxedNewService, BoxedService};
use actix_service::{IntoNewService, NewService, Service};
use actix_web::dev::{
HttpServiceFactory, Payload, ResourceDef, ServiceConfig, ServiceFromRequest,
ServiceRequest, ServiceResponse,
HttpServiceFactory, Payload, ResourceDef, ServiceConfig, ServiceRequest,
ServiceResponse,
};
use actix_web::error::{BlockingError, Error, ErrorInternalServerError};
use actix_web::http::header::DispositionType;
@ -551,8 +551,8 @@ impl<P> FromRequest<P> for PathBufWrp {
type Error = UriSegmentError;
type Future = Result<Self, Self::Error>;
fn from_request(req: &mut ServiceFromRequest<P>) -> Self::Future {
PathBufWrp::get_pathbuf(req.request().match_info().path())
fn from_request(req: &HttpRequest, _: &mut Payload<P>) -> Self::Future {
PathBufWrp::get_pathbuf(req.match_info().path())
}
}