about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2024-09-14 20:22:40 +1000
committerGitHub <noreply@github.com>2024-09-14 20:22:40 +1000
commitc992f97cb1a63294ddfc5fa3789d24eeebd7b8be (patch)
tree3b4cad87da4633d3ea783a7ccfd34aea1be73d38
parentf9567d0f2bc8f6f7f45c42d432a5dbbd161a6104 (diff)
parenta5cbb5200d4ec3eb2dd2669f669a3a811a1ceb94 (diff)
downloadrust-c992f97cb1a63294ddfc5fa3789d24eeebd7b8be.tar.gz
rust-c992f97cb1a63294ddfc5fa3789d24eeebd7b8be.zip
Rollup merge of #130053 - glowcoil:next_if-docs, r=jhpratt
fix doc comments for Peekable::next_if(_eq)

Fix references to a nonexistent `consume` function in the doc comments for `Peekable::next_if` and `Peekable::next_if_eq`.
-rw-r--r--library/core/src/iter/adapters/peekable.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/iter/adapters/peekable.rs b/library/core/src/iter/adapters/peekable.rs
index a11b73cbe8e..cc12cd9c356 100644
--- a/library/core/src/iter/adapters/peekable.rs
+++ b/library/core/src/iter/adapters/peekable.rs
@@ -269,7 +269,7 @@ impl<I: Iterator> Peekable<I> {
     /// let mut iter = (0..5).peekable();
     /// // The first item of the iterator is 0; consume it.
     /// assert_eq!(iter.next_if(|&x| x == 0), Some(0));
-    /// // The next item returned is now 1, so `consume` will return `false`.
+    /// // The next item returned is now 1, so `next_if` will return `None`.
     /// assert_eq!(iter.next_if(|&x| x == 0), None);
     /// // `next_if` saves the value of the next item if it was not equal to `expected`.
     /// assert_eq!(iter.next(), Some(1));
@@ -304,7 +304,7 @@ impl<I: Iterator> Peekable<I> {
     /// let mut iter = (0..5).peekable();
     /// // The first item of the iterator is 0; consume it.
     /// assert_eq!(iter.next_if_eq(&0), Some(0));
-    /// // The next item returned is now 1, so `consume` will return `false`.
+    /// // The next item returned is now 1, so `next_if` will return `None`.
     /// assert_eq!(iter.next_if_eq(&0), None);
     /// // `next_if_eq` saves the value of the next item if it was not equal to `expected`.
     /// assert_eq!(iter.next(), Some(1));