diff --git a/src/stream/cycle.rs b/src/stream/cycle.rs index 92f31ec..5210a69 100644 --- a/src/stream/cycle.rs +++ b/src/stream/cycle.rs @@ -22,13 +22,11 @@ enum CycleState { FromBuffer, } -impl Stream for Cycle - where - S: Stream, - T: Clone, - +impl Stream for Cycle +where + S: Stream, + T: Clone, { - type Item = S::Item; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { @@ -47,7 +45,7 @@ impl Stream for Cycle } } else { let mut index = *this.index; - if index == this.buffer.len() { + if index == this.buffer.len() { index = 0 } next = Some(this.buffer[index].clone());