rust/src/test/run-pass/block-vec-map2.rs

12 lines
245 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]);
}