File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,6 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
6666 {
6767 self . iter . rfind ( predicate)
6868 }
69-
70- #[ inline]
71- fn rposition < P > ( & mut self , predicate : P ) -> Option < usize > where
72- P : FnMut ( Self :: Item ) -> bool
73- {
74- self . iter . position ( predicate)
75- }
7669}
7770
7871#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -1688,6 +1688,12 @@ fn test_rposition() {
16881688 assert ! ( v. iter( ) . rposition( g) . is_none( ) ) ;
16891689}
16901690
1691+ #[ test]
1692+ fn test_rev_rposition ( ) {
1693+ let v = [ 0 , 0 , 1 , 1 ] ;
1694+ assert_eq ! ( v. iter( ) . rev( ) . rposition( |& x| x == 1 ) , Some ( 1 ) ) ;
1695+ }
1696+
16911697#[ test]
16921698#[ should_panic]
16931699fn test_rposition_panic ( ) {
You can’t perform that action at this time.
0 commit comments