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 @@ -1628,7 +1628,7 @@ impl<I: Iterator> Peekable<I> {
1628
1628
self . peeked . get_or_insert_with ( || iter. next ( ) ) . as_ref ( )
1629
1629
}
1630
1630
1631
- /// Consume the next value of this iterator if a condition is true.
1631
+ /// Consume and return the next value of this iterator if a condition is true.
1632
1632
///
1633
1633
/// If `func` returns `true` for the next value of this iterator, consume and return it.
1634
1634
/// Otherwise, return `None`.
@@ -1668,7 +1668,7 @@ impl<I: Iterator> Peekable<I> {
1668
1668
}
1669
1669
}
1670
1670
1671
- /// Consume the next item if it is equal to `expected`.
1671
+ /// Consume and return the next item if it is equal to `expected`.
1672
1672
///
1673
1673
/// # Example
1674
1674
/// Consume a number if it's equal to 0.
@@ -1683,10 +1683,10 @@ impl<I: Iterator> Peekable<I> {
1683
1683
/// assert_eq!(iter.next(), Some(1));
1684
1684
/// ```
1685
1685
#[ unstable( feature = "peekable_next_if" , issue = "72480" ) ]
1686
- pub fn next_if_eq < R > ( & mut self , expected : & R ) -> Option < I :: Item >
1686
+ pub fn next_if_eq < T > ( & mut self , expected : & T ) -> Option < I :: Item >
1687
1687
where
1688
- R : ?Sized ,
1689
- I :: Item : PartialEq < R > ,
1688
+ T : ?Sized ,
1689
+ I :: Item : PartialEq < T > ,
1690
1690
{
1691
1691
self . next_if ( |next| next == expected)
1692
1692
}
You can’t perform that action at this time.
0 commit comments