Skip to content

Commit 68a9e6a

Browse files
committed
Rollup merge of rust-lang#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.
2 parents 63d524d + 2b86f1f commit 68a9e6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libcore/iter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,9 @@ pub trait Iterator {
273273
FilterMap { iter: self, f: f }
274274
}
275275

276-
/// Creates an iterator that yields a pair of the value returned by this
277-
/// iterator plus the current index of iteration.
276+
/// Creates an iterator that yields pairs `(i, val)` where `i` is the
277+
/// current index of iteration and `val` is the value returned by the
278+
/// iterator.
278279
///
279280
/// `enumerate` keeps its count as a `usize`. If you want to count by a
280281
/// different sized integer, the `zip` function provides similar

0 commit comments

Comments
 (0)