File tree 1 file changed +3
-22
lines changed
1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -2819,28 +2819,9 @@ pub trait Iterator {
2819
2819
FromB : Default + Extend < B > ,
2820
2820
Self : Sized + Iterator < Item = ( A , B ) > ,
2821
2821
{
2822
- fn extend < ' a , A , B > (
2823
- ts : & ' a mut impl Extend < A > ,
2824
- us : & ' a mut impl Extend < B > ,
2825
- ) -> impl FnMut ( ( ) , ( A , B ) ) + ' a {
2826
- move |( ) , ( t, u) | {
2827
- ts. extend_one ( t) ;
2828
- us. extend_one ( u) ;
2829
- }
2830
- }
2831
-
2832
- let mut ts: FromA = Default :: default ( ) ;
2833
- let mut us: FromB = Default :: default ( ) ;
2834
-
2835
- let ( lower_bound, _) = self . size_hint ( ) ;
2836
- if lower_bound > 0 {
2837
- ts. extend_reserve ( lower_bound) ;
2838
- us. extend_reserve ( lower_bound) ;
2839
- }
2840
-
2841
- self . fold ( ( ) , extend ( & mut ts, & mut us) ) ;
2842
-
2843
- ( ts, us)
2822
+ let mut unzipped: ( FromA , FromB ) = Default :: default ( ) ;
2823
+ unzipped. extend ( self ) ;
2824
+ unzipped
2844
2825
}
2845
2826
2846
2827
/// Creates an iterator which copies all of its elements.
You can’t perform that action at this time.
0 commit comments