@@ -10,11 +10,9 @@ pub struct Chain<T, U> {
10
10
impl < B , T , U > ParallelIterator < B > for Chain < T , U >
11
11
where
12
12
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 > ,
15
15
{
16
- type Item = T :: Item ;
17
-
18
16
fn next_batch ( & mut self ) -> Option < B > {
19
17
if self . left_in_progress {
20
18
match self . left . next_batch ( ) {
@@ -35,11 +33,9 @@ pub struct Map<P, F> {
35
33
impl < B , U , T , F > ParallelIterator < std:: iter:: Map < B , F > > for Map < U , F >
36
34
where
37
35
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 ,
40
38
{
41
- type Item = T ;
42
-
43
39
fn next_batch ( & mut self ) -> Option < std:: iter:: Map < B , F > > {
44
40
self . iter . next_batch ( ) . map ( |b| b. map ( self . f . clone ( ) ) )
45
41
}
@@ -54,11 +50,9 @@ pub struct Filter<P, F> {
54
50
impl < B , P , F > ParallelIterator < std:: iter:: Filter < B , F > > for Filter < P , F >
55
51
where
56
52
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 ,
59
55
{
60
- type Item = P :: Item ;
61
-
62
56
fn next_batch ( & mut self ) -> Option < std:: iter:: Filter < B , F > > {
63
57
self . iter
64
58
. next_batch ( )
@@ -75,11 +69,9 @@ pub struct FilterMap<P, F> {
75
69
impl < B , P , R , F > ParallelIterator < std:: iter:: FilterMap < B , F > > for FilterMap < P , F >
76
70
where
77
71
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 ,
80
74
{
81
- type Item = R ;
82
-
83
75
fn next_batch ( & mut self ) -> Option < std:: iter:: FilterMap < B , F > > {
84
76
self . iter . next_batch ( ) . map ( |b| b. filter_map ( self . f . clone ( ) ) )
85
77
}
@@ -94,13 +86,11 @@ pub struct FlatMap<P, F> {
94
86
impl < B , P , U , F > ParallelIterator < std:: iter:: FlatMap < B , U , F > > for FlatMap < P , F >
95
87
where
96
88
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 ,
99
91
U : IntoIterator ,
100
92
U :: IntoIter : Send ,
101
93
{
102
- type Item = U :: Item ;
103
-
104
94
// This extends each batch using the flat map. The other option is
105
95
// to turn each IntoIter into its own batch.
106
96
fn next_batch ( & mut self ) -> Option < std:: iter:: FlatMap < B , U , F > > {
@@ -116,12 +106,10 @@ pub struct Flatten<P> {
116
106
impl < B , P > ParallelIterator < std:: iter:: Flatten < B > > for Flatten < P >
117
107
where
118
108
B : Iterator + Send ,
119
- P : ParallelIterator < B , Item = B :: Item > ,
109
+ P : ParallelIterator < B > ,
120
110
B :: Item : IntoIterator ,
121
111
<B :: Item as IntoIterator >:: IntoIter : Send ,
122
112
{
123
- type Item = <P :: Item as IntoIterator >:: Item ;
124
-
125
113
// This extends each batch using the flatten. The other option is to
126
114
// turn each IntoIter into its own batch.
127
115
fn next_batch ( & mut self ) -> Option < std:: iter:: Flatten < B > > {
@@ -137,10 +125,8 @@ pub struct Fuse<P> {
137
125
impl < B , P > ParallelIterator < B > for Fuse < P >
138
126
where
139
127
B : Iterator + Send ,
140
- P : ParallelIterator < B , Item = B :: Item > ,
128
+ P : ParallelIterator < B > ,
141
129
{
142
- type Item = P :: Item ;
143
-
144
130
fn next_batch ( & mut self ) -> Option < B > {
145
131
match & mut self . iter {
146
132
Some ( iter) => match iter. next_batch ( ) {
@@ -164,11 +150,9 @@ pub struct Inspect<P, F> {
164
150
impl < B , P , F > ParallelIterator < std:: iter:: Inspect < B , F > > for Inspect < P , F >
165
151
where
166
152
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 ,
169
155
{
170
- type Item = P :: Item ;
171
-
172
156
fn next_batch ( & mut self ) -> Option < std:: iter:: Inspect < B , F > > {
173
157
self . iter . next_batch ( ) . map ( |b| b. inspect ( self . f . clone ( ) ) )
174
158
}
@@ -182,11 +166,9 @@ pub struct Copied<P> {
182
166
impl < ' a , B , P , T > ParallelIterator < std:: iter:: Copied < B > > for Copied < P >
183
167
where
184
168
B : Iterator < Item = & ' a T > + Send ,
185
- P : ParallelIterator < B , Item = & ' a T > ,
169
+ P : ParallelIterator < B > ,
186
170
T : ' a + Copy ,
187
171
{
188
- type Item = T ;
189
-
190
172
fn next_batch ( & mut self ) -> Option < std:: iter:: Copied < B > > {
191
173
self . iter . next_batch ( ) . map ( |b| b. copied ( ) )
192
174
}
@@ -200,11 +182,9 @@ pub struct Cloned<P> {
200
182
impl < ' a , B , P , T > ParallelIterator < std:: iter:: Cloned < B > > for Cloned < P >
201
183
where
202
184
B : Iterator < Item = & ' a T > + Send ,
203
- P : ParallelIterator < B , Item = & ' a T > ,
185
+ P : ParallelIterator < B > ,
204
186
T : ' a + Copy ,
205
187
{
206
- type Item = T ;
207
-
208
188
fn next_batch ( & mut self ) -> Option < std:: iter:: Cloned < B > > {
209
189
self . iter . next_batch ( ) . map ( |b| b. cloned ( ) )
210
190
}
@@ -219,10 +199,8 @@ pub struct Cycle<P> {
219
199
impl < B , P > ParallelIterator < B > for Cycle < P >
220
200
where
221
201
B : Iterator + Send ,
222
- P : ParallelIterator < B , Item = B :: Item > + Clone ,
202
+ P : ParallelIterator < B > + Clone ,
223
203
{
224
- type Item = P :: Item ;
225
-
226
204
fn next_batch ( & mut self ) -> Option < B > {
227
205
match self . curr . as_mut ( ) . and_then ( |c| c. next_batch ( ) ) {
228
206
batch @ Some ( _) => batch,
0 commit comments