Rollup merge of #41528 - steveklabnik:gh33269, r=frewsxcv
Clarify "side effect" in peek's docs Fixes #33269 /cc @tshepang
This commit is contained in:
commit
9ae413c386
|
@ -629,8 +629,9 @@ pub trait Iterator {
|
||||||
///
|
///
|
||||||
/// Note that the underlying iterator is still advanced when [`peek`] is
|
/// Note that the underlying iterator is still advanced when [`peek`] is
|
||||||
/// called for the first time: In order to retrieve the next element,
|
/// called for the first time: In order to retrieve the next element,
|
||||||
/// [`next`] is called on the underlying iterator, hence any side effects of
|
/// [`next`] is called on the underlying iterator, hence any side effects (i.e.
|
||||||
/// the [`next`] method will occur.
|
/// anything other than fetching the next value) of the [`next`] method
|
||||||
|
/// will occur.
|
||||||
///
|
///
|
||||||
/// [`peek`]: struct.Peekable.html#method.peek
|
/// [`peek`]: struct.Peekable.html#method.peek
|
||||||
/// [`next`]: ../../std/iter/trait.Iterator.html#tymethod.next
|
/// [`next`]: ../../std/iter/trait.Iterator.html#tymethod.next
|
||||||
|
|
Loading…
Reference in New Issue