1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 20:12:58 +01:00

fix Clone impl for Timeout

This commit is contained in:
Nikolay Kim 2019-02-03 11:37:34 -08:00
parent 406088524e
commit 663ae53954

View File

@ -12,7 +12,7 @@ use futures::{Async, Future, Poll};
use tokio_timer::{clock, Delay}; use tokio_timer::{clock, Delay};
/// Applies a timeout to requests. /// Applies a timeout to requests.
#[derive(Debug, Clone)] #[derive(Debug)]
pub struct Timeout<E = ()> { pub struct Timeout<E = ()> {
timeout: Duration, timeout: Duration,
_t: PhantomData<E>, _t: PhantomData<E>,
@ -65,6 +65,12 @@ impl<E> Timeout<E> {
} }
} }
impl<E> Clone for Timeout<E> {
fn clone(&self) -> Self {
Timeout::new(self.timeout)
}
}
impl<S, E> NewTransform<S> for Timeout<E> impl<S, E> NewTransform<S> for Timeout<E>
where where
S: Service, S: Service,