File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -2819,28 +2819,9 @@ pub trait Iterator {
28192819 FromB : Default + Extend < B > ,
28202820 Self : Sized + Iterator < Item = ( A , B ) > ,
28212821 {
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
28442825 }
28452826
28462827 /// Creates an iterator which copies all of its elements.
You can’t perform that action at this time.
0 commit comments