File tree 1 file changed +3
-3
lines changed
library/core/src/iter/adapters
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ impl<I: Iterator> Peekable<I> {
271
271
/// assert_eq!(iter.next_if(|&x| x == 0), Some(0));
272
272
/// // The next item returned is now 1, so `next_if` will return `None`.
273
273
/// assert_eq!(iter.next_if(|&x| x == 0), None);
274
- /// // `next_if` saves the value of the next item if it was not equal to `expected` .
274
+ /// // `next_if` retains the next item if the predicate evaluates to `false` for it .
275
275
/// assert_eq!(iter.next(), Some(1));
276
276
/// ```
277
277
///
@@ -304,9 +304,9 @@ impl<I: Iterator> Peekable<I> {
304
304
/// let mut iter = (0..5).peekable();
305
305
/// // The first item of the iterator is 0; consume it.
306
306
/// assert_eq!(iter.next_if_eq(&0), Some(0));
307
- /// // The next item returned is now 1, so `next_if ` will return `None`.
307
+ /// // The next item returned is now 1, so `next_if_eq ` will return `None`.
308
308
/// assert_eq!(iter.next_if_eq(&0), None);
309
- /// // `next_if_eq` saves the value of the next item if it was not equal to `expected`.
309
+ /// // `next_if_eq` retains the next item if it was not equal to `expected`.
310
310
/// assert_eq!(iter.next(), Some(1));
311
311
/// ```
312
312
#[ stable( feature = "peekable_next_if" , since = "1.51.0" ) ]
You can’t perform that action at this time.
0 commit comments