@@ -2235,6 +2235,14 @@ impl<'a, K, V> Iterator for Iter<'a, K, V> {
22352235 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
22362236 self . base . size_hint ( )
22372237 }
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+ }
22382246}
22392247#[ stable( feature = "rust1" , since = "1.0.0" ) ]
22402248impl < K , V > ExactSizeIterator for Iter < ' _ , K , V > {
@@ -2259,6 +2267,14 @@ impl<'a, K, V> Iterator for IterMut<'a, K, V> {
22592267 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
22602268 self . base . size_hint ( )
22612269 }
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+ }
22622278}
22632279#[ stable( feature = "rust1" , since = "1.0.0" ) ]
22642280impl < K , V > ExactSizeIterator for IterMut < ' _ , K , V > {
@@ -2293,6 +2309,14 @@ impl<K, V> Iterator for IntoIter<K, V> {
22932309 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
22942310 self . base . size_hint ( )
22952311 }
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+ }
22962320}
22972321#[ stable( feature = "rust1" , since = "1.0.0" ) ]
22982322impl < K , V > ExactSizeIterator for IntoIter < K , V > {
@@ -2323,6 +2347,14 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
23232347 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
23242348 self . inner . size_hint ( )
23252349 }
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+ }
23262358}
23272359#[ stable( feature = "rust1" , since = "1.0.0" ) ]
23282360impl < K , V > ExactSizeIterator for Keys < ' _ , K , V > {
@@ -2346,6 +2378,14 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
23462378 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
23472379 self . inner . size_hint ( )
23482380 }
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+ }
23492389}
23502390#[ stable( feature = "rust1" , since = "1.0.0" ) ]
23512391impl < K , V > ExactSizeIterator for Values < ' _ , K , V > {
@@ -2369,6 +2409,14 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
23692409 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
23702410 self . inner . size_hint ( )
23712411 }
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+ }
23722420}
23732421#[ stable( feature = "map_values_mut" , since = "1.10.0" ) ]
23742422impl < K , V > ExactSizeIterator for ValuesMut < ' _ , K , V > {
@@ -2399,6 +2447,14 @@ impl<K, V> Iterator for IntoKeys<K, V> {
23992447 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
24002448 self . inner . size_hint ( )
24012449 }
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+ }
24022458}
24032459#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
24042460impl < K , V > ExactSizeIterator for IntoKeys < K , V > {
@@ -2429,6 +2485,14 @@ impl<K, V> Iterator for IntoValues<K, V> {
24292485 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
24302486 self . inner . size_hint ( )
24312487 }
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+ }
24322496}
24332497#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
24342498impl < K , V > ExactSizeIterator for IntoValues < K , V > {
@@ -2459,6 +2523,14 @@ impl<'a, K, V> Iterator for Drain<'a, K, V> {
24592523 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
24602524 self . base . size_hint ( )
24612525 }
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+ }
24622534}
24632535#[ stable( feature = "drain" , since = "1.6.0" ) ]
24642536impl < K , V > ExactSizeIterator for Drain < ' _ , K , V > {
0 commit comments