@@ -70,13 +70,13 @@ pub trait Map<S: Scope, C: DrainContainer> {
7070 /// .map(|x| x + 1)
7171 /// .map(|x| x + 1)
7272 /// .map(Some)
73- /// .into_stream::<Vec<i32>>()
73+ /// .into_stream::<_, Vec<i32>>()
7474 /// .capture()
7575 /// });
7676 ///
7777 /// assert_eq!((4..14).collect::<Vec<_>>(), data.extract()[0].1);
7878 /// ```
79- fn flat_map_builder < ' t , I , L > ( & ' t self , logic : L ) -> FlatMapBuilder < ' t , Self , S , C , L , I >
79+ fn flat_map_builder < ' t , I , L > ( & ' t self , logic : L ) -> FlatMapBuilder < ' t , Self , C , L , I >
8080 where
8181 C : Clone + ' static ,
8282 L : for < ' a > Fn ( C :: Item < ' a > ) -> I ,
@@ -106,16 +106,16 @@ impl<S: Scope, C: Container + DrainContainer> Map<S, C> for StreamCore<S, C> {
106106
107107
108108/// A stream wrapper that allows the accumulation of flatmap logic.
109- pub struct FlatMapBuilder < ' t , T : Map < S , C > , S : Scope , C : Container , F : ' static , I >
109+ pub struct FlatMapBuilder < ' t , T , C : Container , F : ' static , I >
110110where
111111 for < ' a > F : Fn ( C :: Item < ' a > ) -> I ,
112112{
113113 stream : & ' t T ,
114114 logic : F ,
115- marker : std:: marker:: PhantomData < ( S , C ) > ,
115+ marker : std:: marker:: PhantomData < C > ,
116116}
117117
118- impl < ' t , T : Map < S , C > , S : Scope , C : Container + Clone + ' static , F , I > FlatMapBuilder < ' t , T , S , C , F , I >
118+ impl < ' t , T , C : Container + Clone + ' static , F , I > FlatMapBuilder < ' t , T , C , F , I >
119119where
120120 for < ' a > F : Fn ( C :: Item < ' a > ) -> I ,
121121{
@@ -125,7 +125,7 @@ where
125125 }
126126
127127 /// Transform a flatmapped stream through addiitonal logic.
128- pub fn map < G : Fn ( I ) -> I2 + ' static , I2 > ( self , g : G ) -> FlatMapBuilder < ' t , T , S , C , impl Fn ( C :: Item < ' _ > ) -> I2 + ' static , I2 > {
128+ pub fn map < G : Fn ( I ) -> I2 + ' static , I2 > ( self , g : G ) -> FlatMapBuilder < ' t , T , C , impl Fn ( C :: Item < ' _ > ) -> I2 + ' static , I2 > {
129129 let logic = self . logic ;
130130 FlatMapBuilder {
131131 stream : self . stream ,
@@ -134,9 +134,11 @@ where
134134 }
135135 }
136136 /// Convert the wrapper into a stream.
137- pub fn into_stream < C2 > ( self ) -> StreamCore < S , C2 >
137+ pub fn into_stream < S , C2 > ( self ) -> StreamCore < S , C2 >
138138 where
139139 I : IntoIterator ,
140+ S : Scope ,
141+ T : Map < S , C > ,
140142 C2 : SizableContainer + PushInto < I :: Item > + Data ,
141143 {
142144 Map :: flat_map ( self . stream , self . logic )
@@ -157,7 +159,7 @@ mod tests {
157159 . map ( |x| x + 1 )
158160 . map ( |x| x + 1 )
159161 . map ( Some )
160- . into_stream :: < Vec < i32 > > ( )
162+ . into_stream :: < _ , Vec < i32 > > ( )
161163 . capture ( )
162164 } ) ;
163165
0 commit comments