diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-04-15 17:26:07 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-04-15 17:26:07 -0400 |
| commit | 68a9e6a9339660e5a3c2c04e7c8083fdd6fd0cf5 (patch) | |
| tree | 107e54e9642b50a234e7dca221181a5b49221843 | |
| parent | 63d524d4ab246d5f5d5554472180b504c14e1321 (diff) | |
| parent | 2b86f1f428ace09dbf79c0bf75a7dd06fb6441e2 (diff) | |
| download | rust-68a9e6a9339660e5a3c2c04e7c8083fdd6fd0cf5.tar.gz rust-68a9e6a9339660e5a3c2c04e7c8083fdd6fd0cf5.zip | |
Rollup merge of #24440 - nham:improve_enumerate_doc, r=alexcrichton
I found that the current description of `enumerate()` doesn't actually tell you what, specifically, the method does, and you have to look at the example to figure it out. Here's a description that I think is better.
| -rw-r--r-- | src/libcore/iter.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 4a0706906ee..1dac2a18bbb 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -273,8 +273,9 @@ pub trait Iterator { FilterMap { iter: self, f: f } } - /// Creates an iterator that yields a pair of the value returned by this - /// iterator plus the current index of iteration. + /// Creates an iterator that yields pairs `(i, val)` where `i` is the + /// current index of iteration and `val` is the value returned by the + /// iterator. /// /// `enumerate` keeps its count as a `usize`. If you want to count by a /// different sized integer, the `zip` function provides similar |
