diff --git a/src/stream/stream/cycle.rs b/src/stream/stream/cycle.rs index c778149..4d2dbf5 100644 --- a/src/stream/stream/cycle.rs +++ b/src/stream/stream/cycle.rs @@ -7,15 +7,11 @@ use crate::task::{Context, Poll}; pin_project! { /// A stream that will repeatedly yield the same list of elements - pub struct Cycle -where - S: Stream, - S::Item: Clone, - { + pub struct Cycle { #[pin] source: S, index: usize, - buffer: Vec, + buffer: Vec, state: CycleState, } } @@ -26,12 +22,12 @@ enum CycleState { FromBuffer, } -impl Cycle +impl Cycle where S: Stream, S::Item: Clone, { - pub fn new(source: S) -> Cycle { + pub fn new(source: S) -> Cycle { Cycle { source, index: 0, @@ -41,10 +37,10 @@ where } } -impl Stream for Cycle +impl Stream for Cycle where - S: Stream, - S::Item: Clone, + S: Stream, + T: Clone, { type Item = S::Item; diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 7b21bf0..747c54e 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -435,7 +435,7 @@ extension_trait! { # }) ``` "#] - fn cycle(self) -> Cycle + fn cycle(self) -> Cycle where Self: Sized, Self::Item: Clone,