File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,15 @@ use crate::task::{Context, Poll};
77
88pin_project ! {
99 /// A stream that will repeatedly yield the same list of elements
10- pub struct Cycle <S , T > {
10+ pub struct Cycle <S >
11+ where
12+ S : Stream ,
13+ S :: Item : Clone ,
14+ {
1115 #[ pin]
1216 source: S ,
1317 index: usize ,
14- buffer: Vec <T >,
18+ buffer: Vec <S :: Item >,
1519 state: CycleState ,
1620 }
1721}
@@ -22,12 +26,12 @@ enum CycleState {
2226 FromBuffer ,
2327}
2428
25- impl < S > Cycle < S , S :: Item >
29+ impl < S > Cycle < S >
2630where
2731 S : Stream ,
2832 S :: Item : Clone ,
2933{
30- pub fn new ( source : S ) -> Cycle < S , S :: Item > {
34+ pub fn new ( source : S ) -> Cycle < S > {
3135 Cycle {
3236 source,
3337 index : 0 ,
@@ -37,10 +41,10 @@ where
3741 }
3842}
3943
40- impl < S , T > Stream for Cycle < S , T >
44+ impl < S > Stream for Cycle < S >
4145where
42- S : Stream < Item = T > ,
43- T : Clone ,
46+ S : Stream ,
47+ S :: Item : Clone ,
4448{
4549 type Item = S :: Item ;
4650
Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ extension_trait! {
435435 # })
436436 ```
437437 "# ]
438- fn cycle( self ) -> Cycle <Self , Self :: Item >
438+ fn cycle( self ) -> Cycle <Self >
439439 where
440440 Self : Sized ,
441441 Self :: Item : Clone ,
You can’t perform that action at this time.
0 commit comments