@@ -2469,6 +2469,14 @@ impl<K, V, A: Allocator> Iterator for IntoKeys<K, V, A> {
24692469 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
24702470 self . inner . size_hint ( )
24712471 }
2472+ #[ inline]
2473+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2474+ where
2475+ Self : Sized ,
2476+ F : FnMut ( B , Self :: Item ) -> B ,
2477+ {
2478+ self . inner . fold ( init, |acc, ( k, _) | f ( acc, k) )
2479+ }
24722480}
24732481
24742482impl < K , V , A : Allocator > ExactSizeIterator for IntoKeys < K , V , A > {
@@ -2531,6 +2539,14 @@ impl<K, V, A: Allocator> Iterator for IntoValues<K, V, A> {
25312539 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
25322540 self . inner . size_hint ( )
25332541 }
2542+ #[ inline]
2543+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
2544+ where
2545+ Self : Sized ,
2546+ F : FnMut ( B , Self :: Item ) -> B ,
2547+ {
2548+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
2549+ }
25342550}
25352551
25362552impl < K , V , A : Allocator > ExactSizeIterator for IntoValues < K , V , A > {
@@ -4722,6 +4738,17 @@ impl<'a, K, V> Iterator for Iter<'a, K, V> {
47224738 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
47234739 self . inner . size_hint ( )
47244740 }
4741+ #[ cfg_attr( feature = "inline-more" , inline) ]
4742+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
4743+ where
4744+ Self : Sized ,
4745+ F : FnMut ( B , Self :: Item ) -> B ,
4746+ {
4747+ self . inner . fold ( init, |acc, x| unsafe {
4748+ let ( k, v) = x. as_ref ( ) ;
4749+ f ( acc, ( k, v) )
4750+ } )
4751+ }
47254752}
47264753impl < K , V > ExactSizeIterator for Iter < ' _ , K , V > {
47274754 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4750,6 +4777,17 @@ impl<'a, K, V> Iterator for IterMut<'a, K, V> {
47504777 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
47514778 self . inner . size_hint ( )
47524779 }
4780+ #[ cfg_attr( feature = "inline-more" , inline) ]
4781+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
4782+ where
4783+ Self : Sized ,
4784+ F : FnMut ( B , Self :: Item ) -> B ,
4785+ {
4786+ self . inner . fold ( init, |acc, x| unsafe {
4787+ let ( k, v) = x. as_mut ( ) ;
4788+ f ( acc, ( k, v) )
4789+ } )
4790+ }
47534791}
47544792impl < K , V > ExactSizeIterator for IterMut < ' _ , K , V > {
47554793 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4780,6 +4818,14 @@ impl<K, V, A: Allocator> Iterator for IntoIter<K, V, A> {
47804818 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
47814819 self . inner . size_hint ( )
47824820 }
4821+ #[ cfg_attr( feature = "inline-more" , inline) ]
4822+ fn fold < B , F > ( self , init : B , f : F ) -> B
4823+ where
4824+ Self : Sized ,
4825+ F : FnMut ( B , Self :: Item ) -> B ,
4826+ {
4827+ self . inner . fold ( init, f)
4828+ }
47834829}
47844830impl < K , V , A : Allocator > ExactSizeIterator for IntoIter < K , V , A > {
47854831 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4810,6 +4856,14 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
48104856 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
48114857 self . inner . size_hint ( )
48124858 }
4859+ #[ cfg_attr( feature = "inline-more" , inline) ]
4860+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
4861+ where
4862+ Self : Sized ,
4863+ F : FnMut ( B , Self :: Item ) -> B ,
4864+ {
4865+ self . inner . fold ( init, |acc, ( k, _) | f ( acc, k) )
4866+ }
48134867}
48144868impl < K , V > ExactSizeIterator for Keys < ' _ , K , V > {
48154869 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4834,6 +4888,14 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
48344888 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
48354889 self . inner . size_hint ( )
48364890 }
4891+ #[ cfg_attr( feature = "inline-more" , inline) ]
4892+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
4893+ where
4894+ Self : Sized ,
4895+ F : FnMut ( B , Self :: Item ) -> B ,
4896+ {
4897+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
4898+ }
48374899}
48384900impl < K , V > ExactSizeIterator for Values < ' _ , K , V > {
48394901 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4858,6 +4920,14 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
48584920 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
48594921 self . inner . size_hint ( )
48604922 }
4923+ #[ cfg_attr( feature = "inline-more" , inline) ]
4924+ fn fold < B , F > ( self , init : B , mut f : F ) -> B
4925+ where
4926+ Self : Sized ,
4927+ F : FnMut ( B , Self :: Item ) -> B ,
4928+ {
4929+ self . inner . fold ( init, |acc, ( _, v) | f ( acc, v) )
4930+ }
48614931}
48624932impl < K , V > ExactSizeIterator for ValuesMut < ' _ , K , V > {
48634933 #[ cfg_attr( feature = "inline-more" , inline) ]
@@ -4886,6 +4956,14 @@ impl<'a, K, V, A: Allocator> Iterator for Drain<'a, K, V, A> {
48864956 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
48874957 self . inner . size_hint ( )
48884958 }
4959+ #[ cfg_attr( feature = "inline-more" , inline) ]
4960+ fn fold < B , F > ( self , init : B , f : F ) -> B
4961+ where
4962+ Self : Sized ,
4963+ F : FnMut ( B , Self :: Item ) -> B ,
4964+ {
4965+ self . inner . fold ( init, f)
4966+ }
48894967}
48904968impl < K , V , A : Allocator > ExactSizeIterator for Drain < ' _ , K , V , A > {
48914969 #[ cfg_attr( feature = "inline-more" , inline) ]
0 commit comments