]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #39174 - rspeer:iter-nth-doc-fix, r=alexcrichton
authorCorey Farwell <coreyf@rwell.org>
Sat, 11 Feb 2017 04:41:32 +0000 (23:41 -0500)
committerGitHub <noreply@github.com>
Sat, 11 Feb 2017 04:41:32 +0000 (23:41 -0500)
commit17dcc5143844c35640ad675b6f1b42bb22445e8b
treeeacc966551b4ddbeb983df1d816469cce83cbb60
parent064a0ee131b3129fcad68570975ccc85d0fb54d0
parent11d36aec8317dba64e30b98aad75c70e4eed6b3e
Rollup merge of #39174 - rspeer:iter-nth-doc-fix, r=alexcrichton

Fix a misleading statement in `Iterator.nth()`

The `Iterator.nth()` documentation says "Note that all preceding elements will be consumed". I assumed from that that the preceding elements would be the *only* ones that were consumed, but in fact the returned element is consumed as well.

The way I read the documentation, I assumed that `nth(0)` would not discard anything (there are 0 preceding elements, and maybe it just peeks at the start of the iterator somehow), so I added a sentence clarifying that it does. I also rephrased it to avoid the stunted "i.e." phrasing.