@@ -2235,6 +2235,14 @@ impl<'a, K, V> Iterator for Iter<'a, K, V> {
2235
2235
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2236
2236
self . base . size_hint ( )
2237
2237
}
2238
+ #[ inline]
2239
+ fn fold < B , F > ( self , init : B , f : F ) -> B
2240
+ where
2241
+ Self : Sized ,
2242
+ F : FnMut ( B , Self :: Item ) -> B ,
2243
+ {
2244
+ self . base . fold ( init, f)
2245
+ }
2238
2246
}
2239
2247
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2240
2248
impl < K , V > ExactSizeIterator for Iter < ' _ , K , V > {
@@ -2259,6 +2267,14 @@ impl<'a, K, V> Iterator for IterMut<'a, K, V> {
2259
2267
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2260
2268
self . base . size_hint ( )
2261
2269
}
2270
+ #[ inline]
2271
+ fn fold < B , F > ( self , init : B , f : F ) -> B
2272
+ where
2273
+ Self : Sized ,
2274
+ F : FnMut ( B , Self :: Item ) -> B ,
2275
+ {
2276
+ self . base . fold ( init, f)
2277
+ }
2262
2278
}
2263
2279
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2264
2280
impl < K , V > ExactSizeIterator for IterMut < ' _ , K , V > {
@@ -2293,6 +2309,14 @@ impl<K, V> Iterator for IntoIter<K, V> {
2293
2309
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2294
2310
self . base . size_hint ( )
2295
2311
}
2312
+ #[ inline]
2313
+ fn fold < B , F > ( self , init : B , f : F ) -> B
2314
+ where
2315
+ Self : Sized ,
2316
+ F : FnMut ( B , Self :: Item ) -> B ,
2317
+ {
2318
+ self . base . fold ( init, f)
2319
+ }
2296
2320
}
2297
2321
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2298
2322
impl < K , V > ExactSizeIterator for IntoIter < K , V > {
@@ -2323,6 +2347,14 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
2323
2347
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2324
2348
self . inner . size_hint ( )
2325
2349
}
2350
+ #[ inline]
2351
+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2352
+ where
2353
+ Self : Sized ,
2354
+ F : FnMut ( B , Self :: Item ) -> B ,
2355
+ {
2356
+ self . inner . fold ( init, |acc, ( k, _) | f ( acc, k) )
2357
+ }
2326
2358
}
2327
2359
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2328
2360
impl < K , V > ExactSizeIterator for Keys < ' _ , K , V > {
@@ -2346,6 +2378,14 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
2346
2378
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2347
2379
self . inner . size_hint ( )
2348
2380
}
2381
+ #[ inline]
2382
+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2383
+ where
2384
+ Self : Sized ,
2385
+ F : FnMut ( B , Self :: Item ) -> B ,
2386
+ {
2387
+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
2388
+ }
2349
2389
}
2350
2390
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2351
2391
impl < K , V > ExactSizeIterator for Values < ' _ , K , V > {
@@ -2369,6 +2409,14 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
2369
2409
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2370
2410
self . inner . size_hint ( )
2371
2411
}
2412
+ #[ inline]
2413
+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2414
+ where
2415
+ Self : Sized ,
2416
+ F : FnMut ( B , Self :: Item ) -> B ,
2417
+ {
2418
+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
2419
+ }
2372
2420
}
2373
2421
#[ stable( feature = "map_values_mut" , since = "1.10.0" ) ]
2374
2422
impl < K , V > ExactSizeIterator for ValuesMut < ' _ , K , V > {
@@ -2399,6 +2447,14 @@ impl<K, V> Iterator for IntoKeys<K, V> {
2399
2447
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2400
2448
self . inner . size_hint ( )
2401
2449
}
2450
+ #[ inline]
2451
+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2452
+ where
2453
+ Self : Sized ,
2454
+ F : FnMut ( B , Self :: Item ) -> B ,
2455
+ {
2456
+ self . inner . fold ( init, |acc, ( k, _) | f ( acc, k) )
2457
+ }
2402
2458
}
2403
2459
#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
2404
2460
impl < K , V > ExactSizeIterator for IntoKeys < K , V > {
@@ -2429,6 +2485,14 @@ impl<K, V> Iterator for IntoValues<K, V> {
2429
2485
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2430
2486
self . inner . size_hint ( )
2431
2487
}
2488
+ #[ inline]
2489
+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2490
+ where
2491
+ Self : Sized ,
2492
+ F : FnMut ( B , Self :: Item ) -> B ,
2493
+ {
2494
+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
2495
+ }
2432
2496
}
2433
2497
#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
2434
2498
impl < K , V > ExactSizeIterator for IntoValues < K , V > {
@@ -2459,6 +2523,14 @@ impl<'a, K, V> Iterator for Drain<'a, K, V> {
2459
2523
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2460
2524
self . base . size_hint ( )
2461
2525
}
2526
+ #[ inline]
2527
+ fn fold < B , F > ( self , init : B , f : F ) -> B
2528
+ where
2529
+ Self : Sized ,
2530
+ F : FnMut ( B , Self :: Item ) -> B ,
2531
+ {
2532
+ self . base . fold ( init, f)
2533
+ }
2462
2534
}
2463
2535
#[ stable( feature = "drain" , since = "1.6.0" ) ]
2464
2536
impl < K , V > ExactSizeIterator for Drain < ' _ , K , V > {
0 commit comments