about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwtlin1228 <wtlin1228@gmail.com>2024-12-26 13:56:45 +0800
committerwtlin1228 <wtlin1228@gmail.com>2024-12-26 13:56:45 +0800
commitd0c1975e4b458e30eeab37b9cd4e455f8c69cf4d (patch)
treedfb14187f3f9b7d6a32861372137306c9b3b3c84
parenta25032cf444eeba7652ce5165a2be450430890ba (diff)
downloadrust-d0c1975e4b458e30eeab37b9cd4e455f8c69cf4d.tar.gz
rust-d0c1975e4b458e30eeab37b9cd4e455f8c69cf4d.zip
docs: update code example for Iterator#rposition
-rw-r--r--library/core/src/iter/traits/iterator.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index ff39e8ac25f..91c3a4b29b5 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/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")]