rust/src/test/run-pass/block-vec-map2.rs
Marijn Haverbeke fc6b7c8b38 Reformat for new mode syntax, step 1
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00

11 lines
238 B
Rust

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