diff --git a/ntex-service/src/lib.rs b/ntex-service/src/lib.rs index 7499f629..0e7d5e6e 100644 --- a/ntex-service/src/lib.rs +++ b/ntex-service/src/lib.rs @@ -186,7 +186,7 @@ pub trait ServiceFactory { /// Errors produced while building a service. type InitError; - /// The future of the `Service` instance. + /// The future of the `ServiceFactory` instance. type Future: Future>; /// Create and return a new service value asynchronously. diff --git a/ntex/src/web/middleware/defaultheaders.rs b/ntex/src/web/middleware/defaultheaders.rs index 46f09c59..c16c9296 100644 --- a/ntex/src/web/middleware/defaultheaders.rs +++ b/ntex/src/web/middleware/defaultheaders.rs @@ -30,9 +30,8 @@ use crate::web::dev::{WebRequest, WebResponse}; /// } /// ``` #[derive(Clone)] -pub struct DefaultHeaders { +pub struct DefaultHeaders { inner: Rc, - _t: PhantomData, } struct Inner { @@ -40,21 +39,20 @@ struct Inner { headers: HeaderMap, } -impl Default for DefaultHeaders { +impl Default for DefaultHeaders { fn default() -> Self { DefaultHeaders { inner: Rc::new(Inner { ct: false, headers: HeaderMap::new(), }), - _t: PhantomData, } } } -impl DefaultHeaders { +impl DefaultHeaders { /// Construct `DefaultHeaders` middleware. - pub fn new() -> DefaultHeaders { + pub fn new() -> DefaultHeaders { DefaultHeaders::default() } @@ -92,7 +90,7 @@ impl DefaultHeaders { } } -impl Transform for DefaultHeaders +impl Transform for DefaultHeaders where S: Service, Response = WebResponse>, S::Future: 'static, diff --git a/ntex/src/web/middleware/logger.rs b/ntex/src/web/middleware/logger.rs index 2b6310b9..be274f2f 100644 --- a/ntex/src/web/middleware/logger.rs +++ b/ntex/src/web/middleware/logger.rs @@ -77,9 +77,8 @@ use crate::web::HttpResponse; /// /// `%{FOO}e` os.environ['FOO'] /// -pub struct Logger { +pub struct Logger { inner: Rc, - _t: PhantomData, } struct Inner { @@ -87,15 +86,14 @@ struct Inner { exclude: HashSet, } -impl Logger { +impl Logger { /// Create `Logger` middleware with the specified `format`. - pub fn new(format: &str) -> Logger { + pub fn new(format: &str) -> Logger { Logger { inner: Rc::new(Inner { format: Format::new(format), exclude: HashSet::new(), }), - _t: PhantomData, } } @@ -109,7 +107,7 @@ impl Logger { } } -impl Default for Logger { +impl Default for Logger { /// Create `Logger` middleware with format: /// /// ```ignore @@ -121,12 +119,11 @@ impl Default for Logger { format: Format::default(), exclude: HashSet::new(), }), - _t: PhantomData, } } } -impl Transform for Logger +impl Transform for Logger where S: Service, Response = WebResponse>, {