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