libcore: use unboxed closures in ExactSizeIterator
methods
This commit is contained in:
parent
b3cd05642c
commit
aa921b6162
@ -749,7 +749,7 @@ pub trait ExactSizeIterator<A> : DoubleEndedIterator<A> {
|
||||
///
|
||||
/// If no element matches, None is returned.
|
||||
#[inline]
|
||||
fn rposition(&mut self, predicate: |A| -> bool) -> Option<uint> {
|
||||
fn rposition<P>(&mut self, mut predicate: P) -> Option<uint> where P: FnMut(A) -> bool {
|
||||
let len = self.len();
|
||||
for i in range(0, len).rev() {
|
||||
if predicate(self.next_back().expect("rposition: incorrect ExactSizeIterator")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user