Skip to content

Commit

Permalink
Rollup merge of #37314 - tshepang:simple, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
doc: a more simple description of Iterator::nth
  • Loading branch information
GuillaumeGomez authored Oct 21, 2016
2 parents c3802f6 + 3e26a93 commit 1c2d223
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,9 @@ pub trait Iterator {
last
}

/// Consumes the `n` first elements of the iterator, then returns the
/// `next()` one.
/// Returns the `n`th element of the iterator.
///
/// This method will evaluate the iterator `n` times, discarding those elements.
/// After it does so, it will call [`next()`] and return its value.
///
/// [`next()`]: #tymethod.next
/// Note that all preceding elements will be consumed (i.e. discarded).
///
/// Like most indexing operations, the count starts from zero, so `nth(0)`
/// returns the first value, `nth(1)` the second, and so on.
Expand Down

0 comments on commit 1c2d223

Please sign in to comment.