From 7123c7ea3c5014d59bc1e94afb43c7844ebe9fcb Mon Sep 17 00:00:00 2001 From: wtlin1228 Date: Thu, 26 Dec 2024 13:56:45 +0800 Subject: [PATCH] docs: update code example for Iterator#rposition --- core/src/iter/traits/iterator.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/iter/traits/iterator.rs b/core/src/iter/traits/iterator.rs index ff39e8ac25f8f..91c3a4b29b539 100644 --- a/core/src/iter/traits/iterator.rs +++ b/core/src/iter/traits/iterator.rs @@ -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")]