Skip to content

Commit 6ba80f8

Browse files
jhprattgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#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`.
2 parents 74bb3ce + cb89336 commit 6ba80f8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,6 +3051,7 @@ pub trait Iterator {
30513051
///
30523052
/// // we can still use `iter`, as there are more elements.
30533053
/// assert_eq!(iter.next(), Some(&-1));
3054+
/// assert_eq!(iter.next_back(), Some(&3));
30543055
/// ```
30553056
#[inline]
30563057
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)