Skip to content

Commit

Permalink
Clarify "side effect" in peek's docs
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Apr 25, 2017
1 parent 15ce540 commit 696df71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,9 @@ pub trait Iterator {
///
/// Note that the underlying iterator is still advanced when [`peek`] is
/// called for the first time: In order to retrieve the next element,
/// [`next`] is called on the underlying iterator, hence any side effects of
/// the [`next`] method will occur.
/// [`next`] is called on the underlying iterator, hence any side effects (i.e.
/// anything other than fetching the next value) of the [`next`] method
/// will occur.
///
/// [`peek`]: struct.Peekable.html#method.peek
/// [`next`]: ../../std/iter/trait.Iterator.html#tymethod.next
Expand Down

0 comments on commit 696df71

Please sign in to comment.