File tree 1 file changed +5
-5
lines changed
library/core/src/iter/adapters
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> {
1772
1772
self . peeked . get_or_insert_with ( || iter. next ( ) ) . as_ref ( )
1773
1773
}
1774
1774
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.
1776
1776
///
1777
1777
/// If `func` returns `true` for the next value of this iterator, consume and return it.
1778
1778
/// Otherwise, return `None`.
@@ -1812,7 +1812,7 @@ impl<I: Iterator> Peekable<I> {
1812
1812
}
1813
1813
}
1814
1814
1815
- /// Consume the next item if it is equal to `expected`.
1815
+ /// Consume and return the next item if it is equal to `expected`.
1816
1816
///
1817
1817
/// # Example
1818
1818
/// Consume a number if it's equal to 0.
@@ -1827,10 +1827,10 @@ impl<I: Iterator> Peekable<I> {
1827
1827
/// assert_eq!(iter.next(), Some(1));
1828
1828
/// ```
1829
1829
#[ 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 >
1831
1831
where
1832
- R : ?Sized ,
1833
- I :: Item : PartialEq < R > ,
1832
+ T : ?Sized ,
1833
+ I :: Item : PartialEq < T > ,
1834
1834
{
1835
1835
self . next_if ( |next| next == expected)
1836
1836
}
You can’t perform that action at this time.
0 commit comments