docs: update code example for Iterator#rposition

This commit is contained in:
wtlin1228
2024-12-26 13:56:45 +08:00
parent a25032cf44
commit d0c1975e4b

View File

@@ -3051,6 +3051,7 @@ pub trait Iterator {
/// ///
/// // we can still use `iter`, as there are more elements. /// // we can still use `iter`, as there are more elements.
/// assert_eq!(iter.next(), Some(&-1)); /// assert_eq!(iter.next(), Some(&-1));
/// assert_eq!(iter.next_back(), Some(&3));
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]