@@ -1513,7 +1513,7 @@ impl<A, B> Iterator for Chain<A, B> where
15131513 fn next ( & mut self ) -> Option < A :: Item > {
15141514 match self . state {
15151515 ChainState :: Both => match self . a . next ( ) {
1516- elt @ Some ( ..) => return elt,
1516+ elt @ Some ( ..) => elt,
15171517 None => {
15181518 self . state = ChainState :: Back ;
15191519 self . b . next ( )
@@ -1590,7 +1590,7 @@ impl<A, B> DoubleEndedIterator for Chain<A, B> where
15901590 fn next_back ( & mut self ) -> Option < A :: Item > {
15911591 match self . state {
15921592 ChainState :: Both => match self . b . next_back ( ) {
1593- elt @ Some ( ..) => return elt,
1593+ elt @ Some ( ..) => elt,
15941594 None => {
15951595 self . state = ChainState :: Front ;
15961596 self . a . next_back ( )
@@ -1683,7 +1683,7 @@ impl<B, I: Iterator, F> Iterator for Map<I, F> where F: FnMut(I::Item) -> B {
16831683
16841684 #[ inline]
16851685 fn next ( & mut self ) -> Option < B > {
1686- self . iter . next ( ) . map ( |a| ( self . f ) ( a ) )
1686+ self . iter . next ( ) . map ( & mut self . f )
16871687 }
16881688
16891689 #[ inline]
@@ -1698,7 +1698,7 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for Map<I, F> where
16981698{
16991699 #[ inline]
17001700 fn next_back ( & mut self ) -> Option < B > {
1701- self . iter . next_back ( ) . map ( |a| ( self . f ) ( a ) )
1701+ self . iter . next_back ( ) . map ( & mut self . f )
17021702 }
17031703}
17041704
@@ -2210,7 +2210,7 @@ impl<I: Iterator, U: IntoIterator, F> Iterator for FlatMap<I, U, F>
22102210 return Some ( x)
22112211 }
22122212 }
2213- match self . iter . next ( ) . map ( |x| ( self . f ) ( x ) ) {
2213+ match self . iter . next ( ) . map ( & mut self . f ) {
22142214 None => return self . backiter . as_mut ( ) . and_then ( |it| it. next ( ) ) ,
22152215 next => self . frontiter = next. map ( IntoIterator :: into_iter) ,
22162216 }
@@ -2243,7 +2243,7 @@ impl<I: DoubleEndedIterator, U, F> DoubleEndedIterator for FlatMap<I, U, F> wher
22432243 return Some ( y)
22442244 }
22452245 }
2246- match self . iter . next_back ( ) . map ( |x| ( self . f ) ( x ) ) {
2246+ match self . iter . next_back ( ) . map ( & mut self . f ) {
22472247 None => return self . frontiter . as_mut ( ) . and_then ( |it| it. next_back ( ) ) ,
22482248 next => self . backiter = next. map ( IntoIterator :: into_iter) ,
22492249 }
0 commit comments