@@ -10,11 +10,9 @@ pub struct Chain<T, U> {
1010impl < B , T , U > ParallelIterator < B > for Chain < T , U >
1111where
1212 B : Iterator + Send ,
13- T : ParallelIterator < B , Item = B :: Item > ,
14- U : ParallelIterator < B , Item = T :: Item > ,
13+ T : ParallelIterator < B > ,
14+ U : ParallelIterator < B > ,
1515{
16- type Item = T :: Item ;
17-
1816 fn next_batch ( & mut self ) -> Option < B > {
1917 if self . left_in_progress {
2018 match self . left . next_batch ( ) {
@@ -35,11 +33,9 @@ pub struct Map<P, F> {
3533impl < B , U , T , F > ParallelIterator < std:: iter:: Map < B , F > > for Map < U , F >
3634where
3735 B : Iterator + Send ,
38- U : ParallelIterator < B , Item = B :: Item > ,
39- F : FnMut ( U :: Item ) -> T + Send + Clone ,
36+ U : ParallelIterator < B > ,
37+ F : FnMut ( B :: Item ) -> T + Send + Clone ,
4038{
41- type Item = T ;
42-
4339 fn next_batch ( & mut self ) -> Option < std:: iter:: Map < B , F > > {
4440 self . iter . next_batch ( ) . map ( |b| b. map ( self . f . clone ( ) ) )
4541 }
@@ -54,11 +50,9 @@ pub struct Filter<P, F> {
5450impl < B , P , F > ParallelIterator < std:: iter:: Filter < B , F > > for Filter < P , F >
5551where
5652 B : Iterator + Send ,
57- P : ParallelIterator < B , Item = B :: Item > ,
58- F : FnMut ( & P :: Item ) -> bool + Send + Clone ,
53+ P : ParallelIterator < B > ,
54+ F : FnMut ( & B :: Item ) -> bool + Send + Clone ,
5955{
60- type Item = P :: Item ;
61-
6256 fn next_batch ( & mut self ) -> Option < std:: iter:: Filter < B , F > > {
6357 self . iter
6458 . next_batch ( )
@@ -75,11 +69,9 @@ pub struct FilterMap<P, F> {
7569impl < B , P , R , F > ParallelIterator < std:: iter:: FilterMap < B , F > > for FilterMap < P , F >
7670where
7771 B : Iterator + Send ,
78- P : ParallelIterator < B , Item = B :: Item > ,
79- F : FnMut ( P :: Item ) -> Option < R > + Send + Clone ,
72+ P : ParallelIterator < B > ,
73+ F : FnMut ( B :: Item ) -> Option < R > + Send + Clone ,
8074{
81- type Item = R ;
82-
8375 fn next_batch ( & mut self ) -> Option < std:: iter:: FilterMap < B , F > > {
8476 self . iter . next_batch ( ) . map ( |b| b. filter_map ( self . f . clone ( ) ) )
8577 }
@@ -94,13 +86,11 @@ pub struct FlatMap<P, F> {
9486impl < B , P , U , F > ParallelIterator < std:: iter:: FlatMap < B , U , F > > for FlatMap < P , F >
9587where
9688 B : Iterator + Send ,
97- P : ParallelIterator < B , Item = B :: Item > ,
98- F : FnMut ( P :: Item ) -> U + Send + Clone ,
89+ P : ParallelIterator < B > ,
90+ F : FnMut ( B :: Item ) -> U + Send + Clone ,
9991 U : IntoIterator ,
10092 U :: IntoIter : Send ,
10193{
102- type Item = U :: Item ;
103-
10494 // This extends each batch using the flat map. The other option is
10595 // to turn each IntoIter into its own batch.
10696 fn next_batch ( & mut self ) -> Option < std:: iter:: FlatMap < B , U , F > > {
@@ -116,12 +106,10 @@ pub struct Flatten<P> {
116106impl < B , P > ParallelIterator < std:: iter:: Flatten < B > > for Flatten < P >
117107where
118108 B : Iterator + Send ,
119- P : ParallelIterator < B , Item = B :: Item > ,
109+ P : ParallelIterator < B > ,
120110 B :: Item : IntoIterator ,
121111 <B :: Item as IntoIterator >:: IntoIter : Send ,
122112{
123- type Item = <P :: Item as IntoIterator >:: Item ;
124-
125113 // This extends each batch using the flatten. The other option is to
126114 // turn each IntoIter into its own batch.
127115 fn next_batch ( & mut self ) -> Option < std:: iter:: Flatten < B > > {
@@ -137,10 +125,8 @@ pub struct Fuse<P> {
137125impl < B , P > ParallelIterator < B > for Fuse < P >
138126where
139127 B : Iterator + Send ,
140- P : ParallelIterator < B , Item = B :: Item > ,
128+ P : ParallelIterator < B > ,
141129{
142- type Item = P :: Item ;
143-
144130 fn next_batch ( & mut self ) -> Option < B > {
145131 match & mut self . iter {
146132 Some ( iter) => match iter. next_batch ( ) {
@@ -164,11 +150,9 @@ pub struct Inspect<P, F> {
164150impl < B , P , F > ParallelIterator < std:: iter:: Inspect < B , F > > for Inspect < P , F >
165151where
166152 B : Iterator + Send ,
167- P : ParallelIterator < B , Item = B :: Item > ,
168- F : FnMut ( & P :: Item ) + Send + Clone ,
153+ P : ParallelIterator < B > ,
154+ F : FnMut ( & B :: Item ) + Send + Clone ,
169155{
170- type Item = P :: Item ;
171-
172156 fn next_batch ( & mut self ) -> Option < std:: iter:: Inspect < B , F > > {
173157 self . iter . next_batch ( ) . map ( |b| b. inspect ( self . f . clone ( ) ) )
174158 }
@@ -182,11 +166,9 @@ pub struct Copied<P> {
182166impl < ' a , B , P , T > ParallelIterator < std:: iter:: Copied < B > > for Copied < P >
183167where
184168 B : Iterator < Item = & ' a T > + Send ,
185- P : ParallelIterator < B , Item = & ' a T > ,
169+ P : ParallelIterator < B > ,
186170 T : ' a + Copy ,
187171{
188- type Item = T ;
189-
190172 fn next_batch ( & mut self ) -> Option < std:: iter:: Copied < B > > {
191173 self . iter . next_batch ( ) . map ( |b| b. copied ( ) )
192174 }
@@ -200,11 +182,9 @@ pub struct Cloned<P> {
200182impl < ' a , B , P , T > ParallelIterator < std:: iter:: Cloned < B > > for Cloned < P >
201183where
202184 B : Iterator < Item = & ' a T > + Send ,
203- P : ParallelIterator < B , Item = & ' a T > ,
185+ P : ParallelIterator < B > ,
204186 T : ' a + Copy ,
205187{
206- type Item = T ;
207-
208188 fn next_batch ( & mut self ) -> Option < std:: iter:: Cloned < B > > {
209189 self . iter . next_batch ( ) . map ( |b| b. cloned ( ) )
210190 }
@@ -219,10 +199,8 @@ pub struct Cycle<P> {
219199impl < B , P > ParallelIterator < B > for Cycle < P >
220200where
221201 B : Iterator + Send ,
222- P : ParallelIterator < B , Item = B :: Item > + Clone ,
202+ P : ParallelIterator < B > + Clone ,
223203{
224- type Item = P :: Item ;
225-
226204 fn next_batch ( & mut self ) -> Option < B > {
227205 match self . curr . as_mut ( ) . and_then ( |c| c. next_batch ( ) ) {
228206 batch @ Some ( _) => batch,
0 commit comments