Skip to content

Commit 696df71

Browse files
committed
Clarify "side effect" in peek's docs
Fixes #33269
1 parent 15ce540 commit 696df71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libcore/iter/iterator.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,9 @@ pub trait Iterator {
629629
///
630630
/// Note that the underlying iterator is still advanced when [`peek`] is
631631
/// called for the first time: In order to retrieve the next element,
632-
/// [`next`] is called on the underlying iterator, hence any side effects of
633-
/// the [`next`] method will occur.
632+
/// [`next`] is called on the underlying iterator, hence any side effects (i.e.
633+
/// anything other than fetching the next value) of the [`next`] method
634+
/// will occur.
634635
///
635636
/// [`peek`]: struct.Peekable.html#method.peek
636637
/// [`next`]: ../../std/iter/trait.Iterator.html#tymethod.next

0 commit comments

Comments
 (0)