Fix run-pass tests

This commit is contained in:
Jorge Aparicio 2014-12-03 20:42:22 -05:00
parent 5a9047b9b3
commit 10a14d5f04

View File

@ -12,19 +12,20 @@
// making method calls, but only if there aren't any matches without
// it.
#![feature(unboxed_closures)]
trait iterable<A> {
fn iterate(&self, blk: |x: &A| -> bool) -> bool;
fn iterate<F>(&self, blk: F) -> bool where F: FnMut(&A) -> bool;
}
impl<'a,A> iterable<A> for &'a [A] {
fn iterate(&self, f: |x: &A| -> bool) -> bool {
fn iterate<F>(&self, f: F) -> bool where F: FnMut(&A) -> bool {
self.iter().all(f)
}
}
impl<A> iterable<A> for Vec<A> {
fn iterate(&self, f: |x: &A| -> bool) -> bool {
fn iterate<F>(&self, f: F) -> bool where F: FnMut(&A) -> bool {
self.iter().all(f)
}
}