File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,11 @@ 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 >
11- where
12- S : Stream ,
13- S :: Item : Clone ,
14- {
10+ pub struct Cycle <S , T > {
1511 #[ pin]
1612 source: S ,
1713 index: usize ,
18- buffer: Vec <S :: Item >,
14+ buffer: Vec <T >,
1915 state: CycleState ,
2016 }
2117}
@@ -26,12 +22,12 @@ enum CycleState {
2622 FromBuffer ,
2723}
2824
29- impl < S > Cycle < S >
25+ impl < S > Cycle < S , S :: Item >
3026where
3127 S : Stream ,
3228 S :: Item : Clone ,
3329{
34- pub fn new ( source : S ) -> Cycle < S > {
30+ pub fn new ( source : S ) -> Cycle < S , S :: Item > {
3531 Cycle {
3632 source,
3733 index : 0 ,
@@ -41,10 +37,10 @@ where
4137 }
4238}
4339
44- impl < S > Stream for Cycle < S >
40+ impl < S , T > Stream for Cycle < S , T >
4541where
46- S : Stream ,
47- S :: Item : Clone ,
42+ S : Stream < Item = T > ,
43+ T : Clone ,
4844{
4945 type Item = S :: Item ;
5046
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 >
438+ fn cycle( self ) -> Cycle <Self , Self :: Item >
439439 where
440440 Self : Sized ,
441441 Self :: Item : Clone ,
You can’t perform that action at this time.
0 commit comments