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.
This commit is contained in:
Steve Klabnik 2015-04-15 17:26:07 -04:00
commit 68a9e6a933
1 changed files with 3 additions and 2 deletions

View File

@ -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