1
Fork 0

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:
Jacob Pratt 2024-12-26 21:56:50 -05:00 committed by GitHub
commit 0bfd367612
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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")]