Skip to content

Commit 5386247

Browse files
committed
---
yaml --- r: 55647 b: refs/heads/master c: a2e5350 h: refs/heads/master i: 55645: ffd364a 55643: 3b42666 55639: a5519e9 55631: c8f067e 55615: 792c05f v: v3
1 parent 42dc3af commit 5386247

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1d81b7b286d2be46474022935c5ac111dafd5c4d
2+
refs/heads/master: a2e535028471b715b5a3aaf7cbeb3e6d77a07af6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a

trunk/src/libcore/iterator.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Composable iterator objects
11+
/*! Composable external iterators
12+
13+
The `Iterator` trait defines an interface for objects which implement iteration as a state machine.
14+
15+
Algorithms like `zip` are provided as `Iterator` implementations which wrap other objects
16+
implementing the `Iterator` trait.
17+
18+
*/
1219

1320
use prelude::*;
1421

@@ -17,6 +24,10 @@ pub trait Iterator<A> {
1724
fn next(&mut self) -> Option<A>;
1825
}
1926

27+
/// Iterator adaptors provided for every `Iterator` implementation. The adaptor objects are also
28+
/// implementations of the `Iterator` trait.
29+
///
30+
/// In the future these will be default methods instead of a utility trait.
2031
pub trait IteratorUtil<A> {
2132
fn chain(self, other: Self) -> ChainIterator<Self>;
2233
fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<Self, U>;
@@ -31,6 +42,10 @@ pub trait IteratorUtil<A> {
3142
fn advance(&mut self, f: &fn(A) -> bool);
3243
}
3344

45+
/// Iterator adaptors provided for every `Iterator` implementation. The adaptor objects are also
46+
/// implementations of the `Iterator` trait.
47+
///
48+
/// In the future these will be default methods instead of a utility trait.
3449
impl<A, T: Iterator<A>> IteratorUtil<A> for T {
3550
#[inline(always)]
3651
fn chain(self, other: T) -> ChainIterator<T> {

0 commit comments

Comments
 (0)