mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 16:50:37 +02:00
change Either constructor
This commit is contained in:
@ -33,7 +33,7 @@ pub trait TowerServiceExt {
|
||||
impl<S> TowerServiceExt for S {
|
||||
fn compat<R>(self) -> TowerCompat<Self, R>
|
||||
where
|
||||
Self: TowerService<R> + Sized
|
||||
Self: TowerService<R> + Sized,
|
||||
{
|
||||
TowerCompat::new(self)
|
||||
}
|
||||
@ -61,7 +61,7 @@ where
|
||||
mod tests {
|
||||
use super::TowerServiceExt;
|
||||
use actix_service::{Service as ActixService, ServiceExt, Transform};
|
||||
use futures::{future::FutureResult, Async, Poll, Future};
|
||||
use futures::{future::FutureResult, Async, Future, Poll};
|
||||
use tower_service::Service as TowerService;
|
||||
|
||||
struct RandomService;
|
||||
@ -182,10 +182,13 @@ mod tests {
|
||||
fn tower_service_as_actix_service_can_be_transformed() {
|
||||
let transform = DoMath;
|
||||
|
||||
let mut s = transform.new_transform(RandomService.compat()).wait().unwrap();
|
||||
let mut s = transform
|
||||
.new_transform(RandomService.compat())
|
||||
.wait()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(Ok(Async::Ready(())), s.poll_ready());
|
||||
|
||||
assert_eq!(Ok(Async::Ready(68)), s.call(()).poll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user