about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAndrei Formiga <archimedes_siracusa@hotmail.com>2013-11-17 15:37:00 -0300
committerAndrei Formiga <archimedes_siracusa@hotmail.com>2013-11-17 23:45:29 -0300
commit1f27512b1795697d21e8b23685c9efd56b89c3cf (patch)
treea78de6f356aae6b2e674ce70ff0fdb50a6aa7f3f /src/libstd
parent2839805b9cb5414e4abb789e51adf452cea42315 (diff)
Fixed docs for advance() in Iterator trait
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/iter.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs
index f5979b9b6bf..3897f519e90 100644
--- a/src/libstd/iter.rs
+++ b/src/libstd/iter.rs
@@ -424,16 +424,13 @@ pub trait Iterator<A> {
         ByRef{iter: self}
     }
 
-    /// An adaptation of an external iterator to the for-loop protocol of rust.
+    /// Apply a function to each element, or stop iterating if the
+    /// function returns `false`.
     ///
     /// # Example
     ///
     /// ```rust
-    /// use std::iter::count;
-    ///
-    /// for i in count(0, 10) {
-    ///     println!("{}", i);
-    /// }
+    /// range(0, 5).advance(|x| {print!("{} ", x); true});
     /// ```
     #[inline]
     fn advance(&mut self, f: &fn(A) -> bool) -> bool {