@@ -719,6 +719,24 @@ pub trait IteratorExt: Iterator + Sized {
719
719
}
720
720
} ) . map ( |( x, _) | x)
721
721
}
722
+
723
+ /// Change the direction of the iterator
724
+ ///
725
+ /// The flipped iterator swaps the ends on an iterator that can already
726
+ /// be iterated from the front and from the back.
727
+ ///
728
+ ///
729
+ /// If the iterator also implements RandomAccessIterator, the flipped
730
+ /// iterator is also random access, with the indices starting at the back
731
+ /// of the original iterator.
732
+ ///
733
+ /// Note: Random access with flipped indices still only applies to the first
734
+ /// `uint::MAX` elements of the original iterator.
735
+ #[ inline]
736
+ #[ stable]
737
+ fn rev ( self ) -> Rev < Self > {
738
+ Rev { iter : self }
739
+ }
722
740
}
723
741
724
742
#[ unstable = "trait is unstable" ]
@@ -772,31 +790,6 @@ pub trait DoubleEndedIterator: Iterator {
772
790
fn next_back ( & mut self ) -> Option < <Self as Iterator >:: Item > ;
773
791
}
774
792
775
- /// Extension methods for double-ended iterators.
776
- #[ unstable = "new extension trait convention" ]
777
- pub trait DoubleEndedIteratorExt : DoubleEndedIterator + Sized {
778
- /// Change the direction of the iterator
779
- ///
780
- /// The flipped iterator swaps the ends on an iterator that can already
781
- /// be iterated from the front and from the back.
782
- ///
783
- ///
784
- /// If the iterator also implements RandomAccessIterator, the flipped
785
- /// iterator is also random access, with the indices starting at the back
786
- /// of the original iterator.
787
- ///
788
- /// Note: Random access with flipped indices still only applies to the first
789
- /// `uint::MAX` elements of the original iterator.
790
- #[ inline]
791
- #[ stable]
792
- fn rev ( self ) -> Rev < Self > {
793
- Rev { iter : self }
794
- }
795
- }
796
-
797
- #[ unstable = "trait is unstable" ]
798
- impl < I > DoubleEndedIteratorExt for I where I : DoubleEndedIterator { }
799
-
800
793
/// A double-ended iterator yielding mutable references
801
794
#[ experimental = "not widely used" ]
802
795
pub trait MutableDoubleEndedIterator {
0 commit comments