Rollup merge of #130053 - glowcoil:next_if-docs, r=jhpratt · qinheping/verify-rust-std@857ad22 (original) (raw)

Original file line number Diff line number Diff line change
@@ -269,7 +269,7 @@ impl<I: Iterator> Peekable {
269 269 /// let mut iter = (0..5).peekable();
270 270 /// // The first item of the iterator is 0; consume it.
271 271 /// assert_eq!(iter.next_if(|&x
272 - /// // The next item returned is now 1, so `consume` will return `false`.
272 + /// // The next item returned is now 1, so `next_if` will return `None`.
273 273 /// assert_eq!(iter.next_if(|&x
274 274 /// // `next_if` saves the value of the next item if it was not equal to `expected`.
275 275 /// assert_eq!(iter.next(), Some(1));
@@ -304,7 +304,7 @@ impl<I: Iterator> Peekable {
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 `consume` will return `false`.
307 + /// // The next item returned is now 1, so `next_if` will return `None`.
308 308 /// assert_eq!(iter.next_if_eq(&0), None);
309 309 /// // `next_if_eq` saves the value of the next item if it was not equal to `expected`.
310 310 /// assert_eq!(iter.next(), Some(1));