Closed
Description
https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.rposition
Description should provide a clear meaning for 'index' – index within the collection, or index as number of iteration?
Examples for rposition should demonstrate a clear difference from position.
Here's the example of rposition with an added comparison with the result of the situation with position.
let a = [1, 2, 3];
let mut iter_p = a.iter();
let mut iter_r = a.iter();
assert_eq!(iter_p.position(|&x| x == 2), iter_r.rposition(|&x| x == 2));
My proposition: use the same example as position(F)
let a = [1, 2, 3, 4];
let mut iter = a.iter();
assert_eq!(iter.rposition(|&x| x >= 2), Some(3));