diff --git a/actix-cors/src/lib.rs b/actix-cors/src/lib.rs index 5d0d013e3..ea1eb383b 100644 --- a/actix-cors/src/lib.rs +++ b/actix-cors/src/lib.rs @@ -681,7 +681,7 @@ where type Error = Error; type Future = Either< FutureResult, - Either>>, + Either>>, >; fn poll_ready(&mut self) -> Poll<(), Self::Error> { diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index 8e87f7d89..82abb9990 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -50,7 +50,7 @@ pub struct ChunkedReadFile { size: u64, offset: u64, file: Option, - fut: Option>>>, + fut: Option>>>, counter: u64, } @@ -370,7 +370,7 @@ impl NewService for Files { type Error = Error; type Service = FilesService; type InitError = (); - type Future = Box>; + type Future = Box>; fn new_service(&self, _: &()) -> Self::Future { let mut srv = FilesService { @@ -416,7 +416,7 @@ impl FilesService { req: ServiceRequest, ) -> Either< FutureResult, - Box>, + Box>, > { log::debug!("Files: Failed to handle {}: {}", req.path(), e); if let Some(ref mut default) = self.default { @@ -433,7 +433,7 @@ impl Service for FilesService { type Error = Error; type Future = Either< FutureResult, - Box>, + Box>, >; fn poll_ready(&mut self) -> Poll<(), Self::Error> { diff --git a/actix-framed/src/app.rs b/actix-framed/src/app.rs index 297796bd1..a9d73a25c 100644 --- a/actix-framed/src/app.rs +++ b/actix-framed/src/app.rs @@ -13,7 +13,7 @@ use crate::helpers::{BoxedHttpNewService, BoxedHttpService, HttpNewService}; use crate::request::FramedRequest; use crate::state::State; -type BoxedResponse = Box>; +type BoxedResponse = Box>; pub trait HttpServiceFactory { type Factory: NewService; @@ -61,7 +61,7 @@ impl FramedApp { Request = FramedRequest, Response = (), Error = Error, - Future = Box>, + Future = Box>, >, { let path = factory.path().to_string(); @@ -129,7 +129,7 @@ pub struct CreateService { enum CreateServiceItem { Future( Option, - Box>, Error = ()>>, + Box>, Error = ()>>, ), Service(String, BoxedHttpService>), } diff --git a/actix-framed/src/helpers.rs b/actix-framed/src/helpers.rs index 944b729d4..5e84ad88c 100644 --- a/actix-framed/src/helpers.rs +++ b/actix-framed/src/helpers.rs @@ -7,7 +7,7 @@ pub(crate) type BoxedHttpService = Box< Request = Req, Response = (), Error = Error, - Future = Box>, + Future = Box>, >, >; @@ -19,7 +19,7 @@ pub(crate) type BoxedHttpNewService = Box< Error = Error, InitError = (), Service = BoxedHttpService, - Future = Box, Error = ()>>, + Future = Box, Error = ()>>, >, >; @@ -30,7 +30,7 @@ where T: NewService, T::Response: 'static, T::Future: 'static, - T::Service: Service>> + 'static, + T::Service: Service>> + 'static, ::Future: 'static, { pub fn new(service: T) -> Self { @@ -43,7 +43,7 @@ where T: NewService, T::Request: 'static, T::Future: 'static, - T::Service: Service>> + 'static, + T::Service: Service>> + 'static, ::Future: 'static, { type Config = (); @@ -52,7 +52,7 @@ where type Error = Error; type InitError = (); type Service = BoxedHttpService; - type Future = Box>; + type Future = Box>; fn new_service(&self, _: &()) -> Self::Future { Box::new(self.0.new_service(&()).map_err(|_| ()).and_then(|service| { @@ -70,7 +70,7 @@ impl Service for HttpServiceWrapper where T: Service< Response = (), - Future = Box>, + Future = Box>, Error = Error, >, T::Request: 'static, @@ -78,7 +78,7 @@ where type Request = T::Request; type Response = (); type Error = Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.service.poll_ready() diff --git a/actix-framed/src/route.rs b/actix-framed/src/route.rs index c50401d6d..5beb24165 100644 --- a/actix-framed/src/route.rs +++ b/actix-framed/src/route.rs @@ -140,7 +140,7 @@ where type Request = FramedRequest; type Response = (); type Error = Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { Ok(Async::Ready(())) diff --git a/actix-http/src/client/connection.rs b/actix-http/src/client/connection.rs index 9354fca4a..2f3103d4e 100644 --- a/actix-http/src/client/connection.rs +++ b/actix-http/src/client/connection.rs @@ -94,7 +94,8 @@ where T: AsyncRead + AsyncWrite + 'static, { type Io = T; - type Future = Box>; + type Future = + Box>; fn protocol(&self) -> Protocol { match self.io { @@ -169,7 +170,8 @@ where B: AsyncRead + AsyncWrite + 'static, { type Io = EitherIo; - type Future = Box>; + type Future = + Box>; fn protocol(&self) -> Protocol { match self { diff --git a/actix-identity/src/lib.rs b/actix-identity/src/lib.rs index 6664df676..fe7216a01 100644 --- a/actix-identity/src/lib.rs +++ b/actix-identity/src/lib.rs @@ -261,7 +261,7 @@ where type Request = ServiceRequest; type Response = ServiceResponse; type Error = Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.service.borrow_mut().poll_ready() diff --git a/actix-session/src/cookie.rs b/actix-session/src/cookie.rs index 8627ce4c8..87fc0b164 100644 --- a/actix-session/src/cookie.rs +++ b/actix-session/src/cookie.rs @@ -309,7 +309,7 @@ where type Request = ServiceRequest; type Response = ServiceResponse; type Error = S::Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.service.poll_ready() diff --git a/awc/src/connect.rs b/awc/src/connect.rs index 4b564d777..8344abbdc 100644 --- a/awc/src/connect.rs +++ b/awc/src/connect.rs @@ -20,7 +20,7 @@ pub(crate) trait Connect { head: RequestHead, body: Body, addr: Option, - ) -> Box>; + ) -> Box>; /// Send request, returns Response and Framed fn open_tunnel( @@ -49,7 +49,7 @@ where head: RequestHead, body: Body, addr: Option, - ) -> Box> { + ) -> Box> { Box::new( self.0 // connect to the host diff --git a/src/app_service.rs b/src/app_service.rs index 8ab9b352a..6012dcda9 100644 --- a/src/app_service.rs +++ b/src/app_service.rs @@ -23,7 +23,7 @@ type HttpService = BoxedService; type HttpNewService = BoxedNewService<(), ServiceRequest, ServiceResponse, Error, ()>; type BoxedResponse = Either< FutureResult, - Box>, + Box>, >; type FnDataFactory = Box Box, Error = ()>>>; @@ -297,14 +297,14 @@ impl NewService for AppRoutingFactory { } } -type HttpServiceFut = Box>; +type HttpServiceFut = Box>; /// Create app service #[doc(hidden)] pub struct AppRoutingFactoryResponse { fut: Vec, default: Option, - default_fut: Option>>, + default_fut: Option>>, } enum CreateAppRoutingItem { diff --git a/src/extract.rs b/src/extract.rs index 17b5cb40c..1687973ac 100644 --- a/src/extract.rs +++ b/src/extract.rs @@ -94,7 +94,7 @@ where { type Config = T::Config; type Error = Error; - type Future = Box, Error = Error>>; + type Future = Box, Error = Error>>; #[inline] fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future { @@ -165,7 +165,7 @@ where { type Config = T::Config; type Error = Error; - type Future = Box, Error = Error>>; + type Future = Box, Error = Error>>; #[inline] fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future { diff --git a/src/middleware/defaultheaders.rs b/src/middleware/defaultheaders.rs index bddcdd552..ab2d36c2c 100644 --- a/src/middleware/defaultheaders.rs +++ b/src/middleware/defaultheaders.rs @@ -119,7 +119,7 @@ where type Request = ServiceRequest; type Response = ServiceResponse; type Error = Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.service.poll_ready() diff --git a/src/middleware/errhandlers.rs b/src/middleware/errhandlers.rs index ac166e0eb..afe7c72f1 100644 --- a/src/middleware/errhandlers.rs +++ b/src/middleware/errhandlers.rs @@ -15,7 +15,7 @@ pub enum ErrorHandlerResponse { /// New http response got generated Response(ServiceResponse), /// Result is a future that resolves to a new http response - Future(Box, Error = Error>>), + Future(Box, Error = Error>>), } type ErrorHandler = Fn(ServiceResponse) -> Result>; @@ -117,7 +117,7 @@ where type Request = ServiceRequest; type Response = ServiceResponse; type Error = Error; - type Future = Box>; + type Future = Box>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.service.poll_ready() diff --git a/src/resource.rs b/src/resource.rs index c2691eebe..d09beb27b 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -245,7 +245,7 @@ where /// ```rust /// # use actix_web::*; /// # use futures::future::Future; - /// # fn index(req: HttpRequest) -> Box> { + /// # fn index(req: HttpRequest) -> Box> { /// # unimplemented!() /// # } /// App::new().service(web::resource("/").route(web::route().to_async(index))); @@ -478,7 +478,7 @@ pub struct CreateResourceService { fut: Vec, data: Option>, default: Option, - default_fut: Option>>, + default_fut: Option>>, } impl Future for CreateResourceService { @@ -542,7 +542,7 @@ impl Service for ResourceService { type Error = Error; type Future = Either< FutureResult, - Box>, + Box>, >; fn poll_ready(&mut self) -> Poll<(), Self::Error> { diff --git a/src/responder.rs b/src/responder.rs index 39927c78f..4988ad5bc 100644 --- a/src/responder.rs +++ b/src/responder.rs @@ -337,7 +337,7 @@ impl Future for CustomResponderFut { /// use actix_web::{Either, Error, HttpResponse}; /// /// type RegisterResult = -/// Either>>; +/// Either>>; /// /// fn index() -> RegisterResult { /// if is_a_variant() { @@ -411,13 +411,13 @@ where } } -impl Responder for Box> +impl Responder for Box> where I: Responder + 'static, E: Into + 'static, { type Error = Error; - type Future = Box>; + type Future = Box>; #[inline] fn respond_to(self, req: &HttpRequest) -> Self::Future { diff --git a/src/route.rs b/src/route.rs index 660b82002..591175d15 100644 --- a/src/route.rs +++ b/src/route.rs @@ -19,7 +19,7 @@ type BoxedRouteService = Box< Error = Error, Future = Either< FutureResult, - Box>, + Box>, >, >, >; @@ -32,7 +32,7 @@ type BoxedRouteNewService = Box< Error = Error, InitError = (), Service = BoxedRouteService, - Future = Box, Error = ()>>, + Future = Box, Error = ()>>, >, >; @@ -78,8 +78,9 @@ impl NewService for Route { } } -type RouteFuture = - Box, Error = ()>>; +type RouteFuture = Box< + dyn Future, Error = ()>, +>; pub struct CreateRouteService { fut: RouteFuture, @@ -123,7 +124,7 @@ impl Service for RouteService { type Error = Error; type Future = Either< FutureResult, - Box>, + Box>, >; fn poll_ready(&mut self) -> Poll<(), Self::Error> { @@ -317,7 +318,7 @@ where type Error = Error; type InitError = (); type Service = BoxedRouteService; - type Future = Box>; + type Future = Box>; fn new_service(&self, _: &()) -> Self::Future { Box::new( @@ -351,7 +352,7 @@ where type Error = Error; type Future = Either< FutureResult, - Box>, + Box>, >; fn poll_ready(&mut self) -> Poll<(), Self::Error> { diff --git a/src/scope.rs b/src/scope.rs index 400da668d..99afd7d16 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -28,7 +28,7 @@ type HttpService = BoxedService; type HttpNewService = BoxedNewService<(), ServiceRequest, ServiceResponse, Error, ()>; type BoxedResponse = Either< FutureResult, - Box>, + Box>, >; /// Resources scope. @@ -503,10 +503,10 @@ pub struct ScopeFactoryResponse { fut: Vec, data: Option>, default: Option, - default_fut: Option>>, + default_fut: Option>>, } -type HttpServiceFut = Box>; +type HttpServiceFut = Box>; enum CreateScopeServiceItem { Future(Option, Option, HttpServiceFut), diff --git a/src/types/form.rs b/src/types/form.rs index 32d0edb69..e61145b0d 100644 --- a/src/types/form.rs +++ b/src/types/form.rs @@ -73,7 +73,7 @@ where { type Config = FormConfig; type Error = Error; - type Future = Box>; + type Future = Box>; #[inline] fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future { @@ -187,7 +187,7 @@ pub struct UrlEncoded { length: Option, encoding: &'static Encoding, err: Option, - fut: Option>>, + fut: Option>>, } impl UrlEncoded { diff --git a/src/types/json.rs b/src/types/json.rs index de0ffb54c..f309a3c5a 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -169,7 +169,7 @@ where T: DeserializeOwned + 'static, { type Error = Error; - type Future = Box>; + type Future = Box>; type Config = JsonConfig; #[inline] @@ -290,7 +290,7 @@ pub struct JsonBody { length: Option, stream: Option>, err: Option, - fut: Option>>, + fut: Option>>, } impl JsonBody diff --git a/src/types/payload.rs b/src/types/payload.rs index a8e85e4f3..8a634b4c9 100644 --- a/src/types/payload.rs +++ b/src/types/payload.rs @@ -124,7 +124,7 @@ impl FromRequest for Bytes { type Config = PayloadConfig; type Error = Error; type Future = - Either>, FutureResult>; + Either>, FutureResult>; #[inline] fn from_request(req: &HttpRequest, payload: &mut dev::Payload) -> Self::Future { @@ -177,8 +177,10 @@ impl FromRequest for Bytes { impl FromRequest for String { type Config = PayloadConfig; type Error = Error; - type Future = - Either>, FutureResult>; + type Future = Either< + Box>, + FutureResult, + >; #[inline] fn from_request(req: &HttpRequest, payload: &mut dev::Payload) -> Self::Future { @@ -291,7 +293,7 @@ pub struct HttpMessageBody { length: Option, stream: Option>, err: Option, - fut: Option>>, + fut: Option>>, } impl HttpMessageBody {