tests: Remove uses of advance.
This commit is contained in:
parent
f61472d743
commit
5d39d0befa
|
@ -12,7 +12,7 @@ use std::vec::Vec;
|
|||
|
||||
fn main() {
|
||||
let a: Vec<int> = Vec::new();
|
||||
a.iter().advance(|_| -> bool {
|
||||
a.iter().all(|_| -> bool {
|
||||
//~^ ERROR mismatched types
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ trait iterable<A> {
|
|||
|
||||
impl<'a,A> iterable<A> for &'a [A] {
|
||||
fn iterate(&self, f: |x: &A| -> bool) -> bool {
|
||||
self.iter().advance(f)
|
||||
self.iter().all(f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<A> iterable<A> for Vec<A> {
|
||||
fn iterate(&self, f: |x: &A| -> bool) -> bool {
|
||||
self.iter().advance(f)
|
||||
self.iter().all(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ fn add_int(x: &mut Ints, v: int) {
|
|||
|
||||
fn iter_ints(x: &Ints, f: |x: &int| -> bool) -> bool {
|
||||
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() {
|
||||
|
|
Loading…
Reference in New Issue