@@ -22,6 +22,7 @@ pub struct ParIter<'a, K, V, S> {
22
22
impl < ' a , K : Sync , V : Sync , S : Sync > ParallelIterator for ParIter < ' a , K , V , S > {
23
23
type Item = ( & ' a K , & ' a V ) ;
24
24
25
+ #[ cfg_attr( feature = "inline-more" , inline) ]
25
26
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
26
27
where
27
28
C : UnindexedConsumer < Self :: Item > ,
@@ -38,6 +39,7 @@ impl<'a, K: Sync, V: Sync, S: Sync> ParallelIterator for ParIter<'a, K, V, S> {
38
39
}
39
40
40
41
impl < K , V , S > Clone for ParIter < ' _ , K , V , S > {
42
+ #[ cfg_attr( feature = "inline-more" , inline) ]
41
43
fn clone ( & self ) -> Self {
42
44
ParIter { map : self . map }
43
45
}
@@ -63,6 +65,7 @@ pub struct ParKeys<'a, K, V, S> {
63
65
impl < ' a , K : Sync , V : Sync , S : Sync > ParallelIterator for ParKeys < ' a , K , V , S > {
64
66
type Item = & ' a K ;
65
67
68
+ #[ cfg_attr( feature = "inline-more" , inline) ]
66
69
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
67
70
where
68
71
C : UnindexedConsumer < Self :: Item > ,
@@ -76,6 +79,7 @@ impl<'a, K: Sync, V: Sync, S: Sync> ParallelIterator for ParKeys<'a, K, V, S> {
76
79
}
77
80
78
81
impl < K , V , S > Clone for ParKeys < ' _ , K , V , S > {
82
+ #[ cfg_attr( feature = "inline-more" , inline) ]
79
83
fn clone ( & self ) -> Self {
80
84
ParKeys { map : self . map }
81
85
}
@@ -101,6 +105,7 @@ pub struct ParValues<'a, K, V, S> {
101
105
impl < ' a , K : Sync , V : Sync , S : Sync > ParallelIterator for ParValues < ' a , K , V , S > {
102
106
type Item = & ' a V ;
103
107
108
+ #[ cfg_attr( feature = "inline-more" , inline) ]
104
109
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
105
110
where
106
111
C : UnindexedConsumer < Self :: Item > ,
@@ -114,6 +119,7 @@ impl<'a, K: Sync, V: Sync, S: Sync> ParallelIterator for ParValues<'a, K, V, S>
114
119
}
115
120
116
121
impl < K , V , S > Clone for ParValues < ' _ , K , V , S > {
122
+ #[ cfg_attr( feature = "inline-more" , inline) ]
117
123
fn clone ( & self ) -> Self {
118
124
ParValues { map : self . map }
119
125
}
@@ -141,6 +147,7 @@ pub struct ParIterMut<'a, K, V, S> {
141
147
impl < ' a , K : Send + Sync , V : Send , S : Send > ParallelIterator for ParIterMut < ' a , K , V , S > {
142
148
type Item = ( & ' a K , & ' a mut V ) ;
143
149
150
+ #[ cfg_attr( feature = "inline-more" , inline) ]
144
151
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
145
152
where
146
153
C : UnindexedConsumer < Self :: Item > ,
@@ -178,6 +185,7 @@ pub struct ParValuesMut<'a, K, V, S> {
178
185
impl < ' a , K : Send , V : Send , S : Send > ParallelIterator for ParValuesMut < ' a , K , V , S > {
179
186
type Item = & ' a mut V ;
180
187
188
+ #[ cfg_attr( feature = "inline-more" , inline) ]
181
189
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
182
190
where
183
191
C : UnindexedConsumer < Self :: Item > ,
@@ -212,6 +220,7 @@ pub struct IntoParIter<K, V, S> {
212
220
impl < K : Send , V : Send , S : Send > ParallelIterator for IntoParIter < K , V , S > {
213
221
type Item = ( K , V ) ;
214
222
223
+ #[ cfg_attr( feature = "inline-more" , inline) ]
215
224
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
216
225
where
217
226
C : UnindexedConsumer < Self :: Item > ,
@@ -240,6 +249,7 @@ pub struct ParDrain<'a, K, V, S> {
240
249
impl < K : Send , V : Send , S : Send > ParallelIterator for ParDrain < ' _ , K , V , S > {
241
250
type Item = ( K , V ) ;
242
251
252
+ #[ cfg_attr( feature = "inline-more" , inline) ]
243
253
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
244
254
where
245
255
C : UnindexedConsumer < Self :: Item > ,
@@ -258,24 +268,28 @@ impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher> fmt::Debug
258
268
259
269
impl < K : Sync , V : Sync , S : Sync > HashMap < K , V , S > {
260
270
/// Visits (potentially in parallel) immutably borrowed keys in an arbitrary order.
271
+ #[ cfg_attr( feature = "inline-more" , inline) ]
261
272
pub fn par_keys ( & self ) -> ParKeys < ' _ , K , V , S > {
262
273
ParKeys { map : self }
263
274
}
264
275
265
276
/// Visits (potentially in parallel) immutably borrowed values in an arbitrary order.
277
+ #[ cfg_attr( feature = "inline-more" , inline) ]
266
278
pub fn par_values ( & self ) -> ParValues < ' _ , K , V , S > {
267
279
ParValues { map : self }
268
280
}
269
281
}
270
282
271
283
impl < K : Send , V : Send , S : Send > HashMap < K , V , S > {
272
284
/// Visits (potentially in parallel) mutably borrowed values in an arbitrary order.
285
+ #[ cfg_attr( feature = "inline-more" , inline) ]
273
286
pub fn par_values_mut ( & mut self ) -> ParValuesMut < ' _ , K , V , S > {
274
287
ParValuesMut { map : self }
275
288
}
276
289
277
290
/// Consumes (potentially in parallel) all values in an arbitrary order,
278
291
/// while preserving the map's allocated memory for reuse.
292
+ #[ cfg_attr( feature = "inline-more" , inline) ]
279
293
pub fn par_drain ( & mut self ) -> ParDrain < ' _ , K , V , S > {
280
294
ParDrain { map : self }
281
295
}
@@ -303,6 +317,7 @@ impl<K: Send, V: Send, S: Send> IntoParallelIterator for HashMap<K, V, S> {
303
317
type Item = ( K , V ) ;
304
318
type Iter = IntoParIter < K , V , S > ;
305
319
320
+ #[ cfg_attr( feature = "inline-more" , inline) ]
306
321
fn into_par_iter ( self ) -> Self :: Iter {
307
322
IntoParIter { map : self }
308
323
}
@@ -312,6 +327,7 @@ impl<'a, K: Sync, V: Sync, S: Sync> IntoParallelIterator for &'a HashMap<K, V, S
312
327
type Item = ( & ' a K , & ' a V ) ;
313
328
type Iter = ParIter < ' a , K , V , S > ;
314
329
330
+ #[ cfg_attr( feature = "inline-more" , inline) ]
315
331
fn into_par_iter ( self ) -> Self :: Iter {
316
332
ParIter { map : self }
317
333
}
@@ -321,6 +337,7 @@ impl<'a, K: Send + Sync, V: Send, S: Send> IntoParallelIterator for &'a mut Hash
321
337
type Item = ( & ' a K , & ' a mut V ) ;
322
338
type Iter = ParIterMut < ' a , K , V , S > ;
323
339
340
+ #[ cfg_attr( feature = "inline-more" , inline) ]
324
341
fn into_par_iter ( self ) -> Self :: Iter {
325
342
ParIterMut { map : self }
326
343
}
0 commit comments