Skip to content

Commit 0bfd367

Browse files
authored
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 50c3696 + d0c1975 commit 0bfd367

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/iter/traits/iterator.rs

+1
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)