We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c807277 + a20672c commit beb2240Copy full SHA for beb2240
library/core/src/iter/traits/iterator.rs
@@ -2906,14 +2906,14 @@ pub trait Iterator {
2906
/// Stopping at the first `true`:
2907
///
2908
/// ```
2909
- /// let a = [1, 2, 3];
+ /// let a = [-1, 2, 3, 4];
2910
2911
/// let mut iter = a.iter();
2912
2913
- /// assert_eq!(iter.rposition(|&x| x == 2), Some(1));
+ /// assert_eq!(iter.rposition(|&x| x >= 2), Some(3));
2914
2915
/// // we can still use `iter`, as there are more elements.
2916
- /// assert_eq!(iter.next(), Some(&1));
+ /// assert_eq!(iter.next(), Some(&-1));
2917
2918
#[inline]
2919
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments