Fix some iter tests
This commit is contained in:
parent
6d4621d85f
commit
907fa74e8b
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn is_even(+x: uint) -> bool { (x % 2) == 0 }
|
||||
fn is_even(x: &uint) -> bool { (*x % 2) == 0 }
|
||||
|
||||
fn main() {
|
||||
assert [1, 3].filter_to_vec(is_even) == ~[];
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn inc(+x: uint) -> uint { x + 1 }
|
||||
fn inc(x: &uint) -> uint { *x + 1 }
|
||||
|
||||
fn main() {
|
||||
assert [1, 3].map_to_vec(inc) == ~[2, 4];
|
||||
|
Loading…
x
Reference in New Issue
Block a user