mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
Fix run-pass tests
This commit is contained in:
parent
5a9047b9b3
commit
10a14d5f04
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user