File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
library/core/src/iter/adapters Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1772,7 +1772,7 @@ impl<I: Iterator> Peekable<I> {
17721772 self . peeked . get_or_insert_with ( || iter. next ( ) ) . as_ref ( )
17731773 }
17741774
1775- /// Consume the next value of this iterator if a condition is true.
1775+ /// Consume and return the next value of this iterator if a condition is true.
17761776 ///
17771777 /// If `func` returns `true` for the next value of this iterator, consume and return it.
17781778 /// Otherwise, return `None`.
@@ -1812,7 +1812,7 @@ impl<I: Iterator> Peekable<I> {
18121812 }
18131813 }
18141814
1815- /// Consume the next item if it is equal to `expected`.
1815+ /// Consume and return the next item if it is equal to `expected`.
18161816 ///
18171817 /// # Example
18181818 /// Consume a number if it's equal to 0.
@@ -1827,10 +1827,10 @@ impl<I: Iterator> Peekable<I> {
18271827 /// assert_eq!(iter.next(), Some(1));
18281828 /// ```
18291829 #[ unstable( feature = "peekable_next_if" , issue = "72480" ) ]
1830- pub fn next_if_eq < R > ( & mut self , expected : & R ) -> Option < I :: Item >
1830+ pub fn next_if_eq < T > ( & mut self , expected : & T ) -> Option < I :: Item >
18311831 where
1832- R : ?Sized ,
1833- I :: Item : PartialEq < R > ,
1832+ T : ?Sized ,
1833+ I :: Item : PartialEq < T > ,
18341834 {
18351835 self . next_if ( |next| next == expected)
18361836 }
You can’t perform that action at this time.
0 commit comments