1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-20 15:17:07 +00:00

update tests

This commit is contained in:
Nikolay Kim 2018-12-06 14:53:55 -08:00
parent 8fe7ce533c
commit e8aa73a44b
10 changed files with 23 additions and 23 deletions

View file

@ -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<Cell<usize>>);
impl Service<&'static str> for Srv1 {

View file

@ -17,7 +17,7 @@ where
impl<T, F, In, Out, Request> Apply<T, F, In, Out, Request>
where
T: Service<Request>,
F: FnMut(In, &mut T) -> Out,
F: Fn(In, &mut T) -> Out,
Out: IntoFuture,
{
/// Create new `Apply` combinator
@ -47,7 +47,7 @@ where
impl<T, F, In, Out, Request> Service<In> for Apply<T, F, In, Out, Request>
where
T: Service<Request, Error = Out::Error>,
F: FnMut(In, &mut T) -> Out,
F: Fn(In, &mut T) -> Out,
Out: IntoFuture,
{
type Response = <Out::Future as Future>::Item;
@ -76,7 +76,7 @@ where
impl<T, F, In, Out, Request> ApplyNewService<T, F, In, Out, Request>
where
T: NewService<Request>,
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<T, F, In, Out, Request> Clone for ApplyNewService<T, F, In, Out, Request>
where
T: NewService<Request> + 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<T, F, In, Out, Request> NewService<In> for ApplyNewService<T, F, In, Out, Request>
where
T: NewService<Request, Error = Out::Error>,
F: FnMut(In, &mut T::Service) -> Out + Clone,
F: Fn(In, &mut T::Service) -> Out + Clone,
Out: IntoFuture,
{
type Response = <Out::Future as Future>::Item;
@ -125,7 +125,7 @@ where
pub struct ApplyNewServiceFuture<T, F, In, Out, Request>
where
T: NewService<Request>,
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<T, F, In, Out, Request> ApplyNewServiceFuture<T, F, In, Out, Request>
where
T: NewService<Request>,
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<T, F, In, Out, Request> Future for ApplyNewServiceFuture<T, F, In, Out, Request>
where
T: NewService<Request>,
F: FnMut(In, &mut T::Service) -> Out,
F: Fn(In, &mut T::Service) -> Out,
Out: IntoFuture,
{
type Item = Apply<T::Service, F, In, Out, Request>;
@ -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,
};

View file

@ -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 {

View file

@ -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 {

View file

@ -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;

View file

@ -35,7 +35,7 @@ pub trait ServiceExt<Request>: Service<Request> {
Self: Sized,
T: Service<Req, Error = Out::Error>,
I: IntoService<T, Req>,
F: FnMut(Self::Response, &mut T) -> Out,
F: Fn(Self::Response, &mut T) -> Out,
Out: IntoFuture<Error = Self::Error>,
{
self.and_then(Apply::new(service.into_service(), f))
@ -158,7 +158,7 @@ pub trait NewServiceExt<Request>: NewService<Request> {
Self: Sized,
T: NewService<Req, InitError = Self::InitError, Error = Out::Error>,
I: IntoNewService<T, Req>,
F: FnMut(Self::Response, &mut T::Service) -> Out + Clone,
F: Fn(Self::Response, &mut T::Service) -> Out + Clone,
Out: IntoFuture<Error = Self::Error>,
{
self.and_then(ApplyNewService::new(service, f))

View file

@ -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<Cell<usize>>);

View file

@ -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
///

View file

@ -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
///

View file

@ -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
///