Skip to content

Commit 1f27512

Browse files
committed
Fixed docs for advance() in Iterator trait
1 parent 2839805 commit 1f27512

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/libstd/iter.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,13 @@ pub trait Iterator<A> {
424424
ByRef{iter: self}
425425
}
426426

427-
/// An adaptation of an external iterator to the for-loop protocol of rust.
427+
/// Apply a function to each element, or stop iterating if the
428+
/// function returns `false`.
428429
///
429430
/// # Example
430431
///
431432
/// ```rust
432-
/// use std::iter::count;
433-
///
434-
/// for i in count(0, 10) {
435-
/// println!("{}", i);
436-
/// }
433+
/// range(0, 5).advance(|x| {print!("{} ", x); true});
437434
/// ```
438435
#[inline]
439436
fn advance(&mut self, f: &fn(A) -> bool) -> bool {

0 commit comments

Comments
 (0)