1
Fork 0

tests: Remove uses of advance.

This commit is contained in:
Luqman Aden 2014-07-07 15:22:23 -07:00
parent f61472d743
commit 5d39d0befa
3 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ use std::vec::Vec;
fn main() { fn main() {
let a: Vec<int> = Vec::new(); let a: Vec<int> = Vec::new();
a.iter().advance(|_| -> bool { a.iter().all(|_| -> bool {
//~^ ERROR mismatched types //~^ ERROR mismatched types
}); });
} }

View file

@ -19,13 +19,13 @@ trait iterable<A> {
impl<'a,A> iterable<A> for &'a [A] { impl<'a,A> iterable<A> for &'a [A] {
fn iterate(&self, f: |x: &A| -> bool) -> bool { fn iterate(&self, f: |x: &A| -> bool) -> bool {
self.iter().advance(f) self.iter().all(f)
} }
} }
impl<A> iterable<A> for Vec<A> { impl<A> iterable<A> for Vec<A> {
fn iterate(&self, f: |x: &A| -> bool) -> bool { fn iterate(&self, f: |x: &A| -> bool) -> bool {
self.iter().advance(f) self.iter().all(f)
} }
} }

View file

@ -24,7 +24,7 @@ fn add_int(x: &mut Ints, v: int) {
fn iter_ints(x: &Ints, f: |x: &int| -> bool) -> bool { fn iter_ints(x: &Ints, f: |x: &int| -> bool) -> bool {
let l = x.values.len(); let l = x.values.len();
range(0u, l).advance(|i| f(x.values.get(i))) range(0u, l).all(|i| f(x.values.get(i)))
} }
pub fn main() { pub fn main() {