@@ -161,7 +161,7 @@ pub trait Iterator {
161
161
#[ inline]
162
162
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
163
163
fn nth ( & mut self , mut n : usize ) -> Option < Self :: Item > where Self : Sized {
164
- for x in self . by_ref ( ) {
164
+ for x in self {
165
165
if n == 0 { return Some ( x) }
166
166
n -= 1 ;
167
167
}
@@ -636,7 +636,7 @@ pub trait Iterator {
636
636
fn all < F > ( & mut self , mut f : F ) -> bool where
637
637
Self : Sized , F : FnMut ( Self :: Item ) -> bool
638
638
{
639
- for x in self . by_ref ( ) {
639
+ for x in self {
640
640
if !f ( x) {
641
641
return false ;
642
642
}
@@ -663,7 +663,7 @@ pub trait Iterator {
663
663
Self : Sized ,
664
664
F : FnMut ( Self :: Item ) -> bool
665
665
{
666
- for x in self . by_ref ( ) {
666
+ for x in self {
667
667
if f ( x) {
668
668
return true ;
669
669
}
@@ -688,7 +688,7 @@ pub trait Iterator {
688
688
Self : Sized ,
689
689
P : FnMut ( & Self :: Item ) -> bool ,
690
690
{
691
- for x in self . by_ref ( ) {
691
+ for x in self {
692
692
if predicate ( & x) { return Some ( x) }
693
693
}
694
694
None
@@ -724,7 +724,7 @@ pub trait Iterator {
724
724
P : FnMut ( Self :: Item ) -> bool ,
725
725
{
726
726
// `enumerate` might overflow.
727
- for ( i, x) in self . by_ref ( ) . enumerate ( ) {
727
+ for ( i, x) in self . enumerate ( ) {
728
728
if predicate ( x) {
729
729
return Some ( i) ;
730
730
}
0 commit comments