diff options
| author | bors <bors@rust-lang.org> | 2017-02-11 07:18:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-11 07:18:21 +0000 |
| commit | bae454edc5e18e81b831baf4a7647bf2dda620a8 (patch) | |
| tree | 28a201289681561c459b983df21f339d0b7a8591 /src/libcore/iter/iterator.rs | |
| parent | f140a6c6effa9fe11f97373d995e6c0d977b509f (diff) | |
| parent | 56275f82a83ff4fa83620b0debe1c964e4e434f9 (diff) | |
Auto merge of #39736 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests - Successful merges: #39174, #39660, #39676, #39692, #39701, #39710, #39721, #39724, #39725 - Failed merges:
Diffstat (limited to 'src/libcore/iter/iterator.rs')
| -rw-r--r-- | src/libcore/iter/iterator.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 3b406873d4b..d41767cce18 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -209,11 +209,14 @@ pub trait Iterator { /// Returns the `n`th element of the iterator. /// - /// 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. /// + /// Note that all preceding elements, as well as the returned element, will be + /// consumed from the iterator. That means that the preceding elements will be + /// discarded, and also that calling `nth(0)` multiple times on the same iterator + /// will return different elements. + /// /// `nth()` will return [`None`] if `n` is greater than or equal to the length of the /// iterator. /// |
