rust/src/test/run-pass/for-destruct.rs

6 lines
118 B
Rust

fn main() {
for vec::each([{x: 10, y: 20}, {x: 30, y: 0}]/~) {|elt|
assert (elt.x + elt.y == 30);
}
}