rust/src/test/run-pass/block-vec-map2.rs
2012-07-01 19:19:32 -07:00

12 lines
246 B
Rust

use std;
import vec;
fn main() {
let v =
vec::map2(~[1, 2, 3, 4, 5],
~[true, false, false, true, true],
|i, b| if b { -i } else { i } );
log(error, v);
assert (v == ~[-1, 2, 3, -4, -5]);
}