Skip to content

Commit aa921b6

Browse files
author
Jorge Aparicio
committed
libcore: use unboxed closures in ExactSizeIterator methods
1 parent b3cd056 commit aa921b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ pub trait ExactSizeIterator<A> : DoubleEndedIterator<A> {
749749
///
750750
/// If no element matches, None is returned.
751751
#[inline]
752-
fn rposition(&mut self, predicate: |A| -> bool) -> Option<uint> {
752+
fn rposition<P>(&mut self, mut predicate: P) -> Option<uint> where P: FnMut(A) -> bool {
753753
let len = self.len();
754754
for i in range(0, len).rev() {
755755
if predicate(self.next_back().expect("rposition: incorrect ExactSizeIterator")) {

0 commit comments

Comments
 (0)