From e8aa73a44bf2292632bf9203ddfffea6047c50bf Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 6 Dec 2018 14:53:55 -0800 Subject: [PATCH] update tests --- src/service/and_then.rs | 2 +- src/service/apply.rs | 18 +++++++++--------- src/service/from_err.rs | 2 +- src/service/map.rs | 2 +- src/service/map_err.rs | 2 +- src/service/mod.rs | 4 ++-- src/service/then.rs | 2 +- src/ssl/nativetls.rs | 4 ++-- src/ssl/openssl.rs | 6 +++--- src/ssl/rustls.rs | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/service/and_then.rs b/src/service/and_then.rs index dde1aae5..f640975e 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -219,7 +219,7 @@ mod tests { use std::rc::Rc; use super::*; - use service::{NewServiceExt, Service, ServiceExt}; + use crate::service::{NewServiceExt, Service, ServiceExt}; struct Srv1(Rc>); impl Service<&'static str> for Srv1 { diff --git a/src/service/apply.rs b/src/service/apply.rs index b9ccc781..071eb79c 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -17,7 +17,7 @@ where impl Apply where T: Service, - F: FnMut(In, &mut T) -> Out, + F: Fn(In, &mut T) -> Out, Out: IntoFuture, { /// Create new `Apply` combinator @@ -47,7 +47,7 @@ where impl Service for Apply where T: Service, - F: FnMut(In, &mut T) -> Out, + F: Fn(In, &mut T) -> Out, Out: IntoFuture, { type Response = ::Item; @@ -76,7 +76,7 @@ where impl ApplyNewService where T: NewService, - F: FnMut(In, &mut T::Service) -> Out, + F: Fn(In, &mut T::Service) -> Out, Out: IntoFuture, { /// Create new `ApplyNewService` new service instance @@ -92,7 +92,7 @@ where impl Clone for ApplyNewService where T: NewService + Clone, - F: FnMut(Out, &mut T::Service) -> Out + Clone, + F: Fn(Out, &mut T::Service) -> Out + Clone, Out: IntoFuture, { fn clone(&self) -> Self { @@ -107,7 +107,7 @@ where impl NewService for ApplyNewService where T: NewService, - F: FnMut(In, &mut T::Service) -> Out + Clone, + F: Fn(In, &mut T::Service) -> Out + Clone, Out: IntoFuture, { type Response = ::Item; @@ -125,7 +125,7 @@ where pub struct ApplyNewServiceFuture where T: NewService, - F: FnMut(In, &mut T::Service) -> Out, + F: Fn(In, &mut T::Service) -> Out, Out: IntoFuture, { fut: T::Future, @@ -136,7 +136,7 @@ where impl ApplyNewServiceFuture where T: NewService, - F: FnMut(In, &mut T::Service) -> Out, + F: Fn(In, &mut T::Service) -> Out, Out: IntoFuture, { fn new(fut: T::Future, f: F) -> Self { @@ -151,7 +151,7 @@ where impl Future for ApplyNewServiceFuture where T: NewService, - F: FnMut(In, &mut T::Service) -> Out, + F: Fn(In, &mut T::Service) -> Out, Out: IntoFuture, { type Item = Apply; @@ -171,7 +171,7 @@ mod tests { use futures::future::{ok, FutureResult}; use futures::{Async, Future, Poll}; - use service::{ + use crate::service::{ IntoNewService, IntoService, NewService, NewServiceExt, Service, ServiceExt, }; diff --git a/src/service/from_err.rs b/src/service/from_err.rs index dc4c4408..37e7c693 100644 --- a/src/service/from_err.rs +++ b/src/service/from_err.rs @@ -159,7 +159,7 @@ mod tests { use futures::future::{err, FutureResult}; use super::*; - use service::{IntoNewService, NewServiceExt, Service, ServiceExt}; + use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt}; struct Srv; impl Service<()> for Srv { diff --git a/src/service/map.rs b/src/service/map.rs index 38e37a27..3e19c15d 100644 --- a/src/service/map.rs +++ b/src/service/map.rs @@ -189,7 +189,7 @@ mod tests { use futures::future::{ok, FutureResult}; use super::*; - use service::{IntoNewService, NewServiceExt, Service, ServiceExt}; + use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt}; struct Srv; impl Service<()> for Srv { diff --git a/src/service/map_err.rs b/src/service/map_err.rs index 6b6cc7ce..81344089 100644 --- a/src/service/map_err.rs +++ b/src/service/map_err.rs @@ -190,7 +190,7 @@ mod tests { use futures::future::{err, FutureResult}; use super::*; - use service::{IntoNewService, NewServiceExt, Service, ServiceExt}; + use crate::service::{IntoNewService, NewServiceExt, Service, ServiceExt}; struct Srv; diff --git a/src/service/mod.rs b/src/service/mod.rs index 6ca60eb7..3952a801 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -35,7 +35,7 @@ pub trait ServiceExt: Service { Self: Sized, T: Service, I: IntoService, - F: FnMut(Self::Response, &mut T) -> Out, + F: Fn(Self::Response, &mut T) -> Out, Out: IntoFuture, { self.and_then(Apply::new(service.into_service(), f)) @@ -158,7 +158,7 @@ pub trait NewServiceExt: NewService { Self: Sized, T: NewService, I: IntoNewService, - F: FnMut(Self::Response, &mut T::Service) -> Out + Clone, + F: Fn(Self::Response, &mut T::Service) -> Out + Clone, Out: IntoFuture, { self.and_then(ApplyNewService::new(service, f)) diff --git a/src/service/then.rs b/src/service/then.rs index 38151a16..44f8b4ce 100644 --- a/src/service/then.rs +++ b/src/service/then.rs @@ -226,7 +226,7 @@ mod tests { use std::rc::Rc; use super::*; - use service::{NewServiceExt, ServiceExt}; + use crate::service::{NewServiceExt, ServiceExt}; #[derive(Clone)] struct Srv1(Rc>); diff --git a/src/ssl/nativetls.rs b/src/ssl/nativetls.rs index f5adbc7e..03a661f1 100644 --- a/src/ssl/nativetls.rs +++ b/src/ssl/nativetls.rs @@ -6,8 +6,8 @@ use native_tls::{self, Error, HandshakeError, TlsAcceptor}; use tokio_io::{AsyncRead, AsyncWrite}; use super::MAX_CONN_COUNTER; -use counter::{Counter, CounterGuard}; -use service::{NewService, Service}; +use crate::counter::{Counter, CounterGuard}; +use crate::service::{NewService, Service}; /// Support `SSL` connections via native-tls package /// diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index ada4eaa3..0cf14820 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -6,9 +6,9 @@ use tokio_io::{AsyncRead, AsyncWrite}; use tokio_openssl::{AcceptAsync, ConnectAsync, SslAcceptorExt, SslConnectorExt, SslStream}; use super::MAX_CONN_COUNTER; -use counter::{Counter, CounterGuard}; -use resolver::RequestHost; -use service::{NewService, Service}; +use crate::counter::{Counter, CounterGuard}; +use crate::resolver::RequestHost; +use crate::service::{NewService, Service}; /// Support `SSL` connections via openssl package /// diff --git a/src/ssl/rustls.rs b/src/ssl/rustls.rs index 5a5b18f0..b3140bcf 100644 --- a/src/ssl/rustls.rs +++ b/src/ssl/rustls.rs @@ -8,8 +8,8 @@ use tokio_io::{AsyncRead, AsyncWrite}; use tokio_rustls::{Accept, TlsAcceptor, TlsStream}; use super::MAX_CONN_COUNTER; -use counter::{Counter, CounterGuard}; -use service::{NewService, Service}; +use crate::counter::{Counter, CounterGuard}; +use crate::service::{NewService, Service}; /// Support `SSL` connections via rustls package ///