@@ -580,44 +580,6 @@ pub trait IteratorExt: Iterator + Sized {
580580 ( left, right)
581581 }
582582
583- /// Loops through `n` iterations, returning the `n`th element of the
584- /// iterator.
585- ///
586- /// # Example
587- ///
588- /// ```rust
589- /// let a = [1, 2, 3, 4, 5];
590- /// let mut it = a.iter();
591- /// assert!(it.nth(2).unwrap() == &3);
592- /// assert!(it.nth(2) == None);
593- /// ```
594- #[ inline]
595- #[ stable]
596- fn nth ( & mut self , mut n : uint ) -> Option < <Self as Iterator >:: Item > {
597- for x in * self {
598- if n == 0 { return Some ( x) }
599- n -= 1 ;
600- }
601- None
602- }
603-
604- /// Loops through the entire iterator, returning the last element of the
605- /// iterator.
606- ///
607- /// # Example
608- ///
609- /// ```rust
610- /// let a = [1, 2, 3, 4, 5];
611- /// assert!(a.iter().last().unwrap() == &5);
612- /// ```
613- #[ inline]
614- #[ unstable = "just changed to take self by value" ]
615- fn last ( mut self ) -> Option < <Self as Iterator >:: Item > {
616- let mut last = None ;
617- for x in self { last = Some ( x) ; }
618- last
619- }
620-
621583 /// Performs a fold operation over the entire iterator, returning the
622584 /// eventual state at the end of the iteration.
623585 ///
@@ -639,21 +601,6 @@ pub trait IteratorExt: Iterator + Sized {
639601 accum
640602 }
641603
642- /// Counts the number of elements in this iterator.
643- ///
644- /// # Example
645- ///
646- /// ```rust
647- /// let a = [1, 2, 3, 4, 5];
648- /// let mut it = a.iter();
649- /// assert!(it.count() == 5);
650- /// ```
651- #[ inline]
652- #[ unstable = "just changed to take self by value" ]
653- fn count ( self ) -> uint {
654- self . fold ( 0 , |cnt, _x| cnt + 1 )
655- }
656-
657604 /// Tests whether the predicate holds true for all elements in the iterator.
658605 ///
659606 /// # Example
0 commit comments