Rollup merge of #134782 - wtlin1228:docs/iter-rposition, r=Mark-Simulacrum
Update Code Example for `Iterator::rposition` Added an additional assertion to the example to show the behavior of `iter.next_back` after using `iter.rposition`.
This commit is contained in:
commit
0bfd367612
1 changed files with 1 additions and 0 deletions
|
@ -3051,6 +3051,7 @@ pub trait Iterator {
|
|||
///
|
||||
/// // we can still use `iter`, as there are more elements.
|
||||
/// assert_eq!(iter.next(), Some(&-1));
|
||||
/// assert_eq!(iter.next_back(), Some(&3));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue