rust/src/test/run-pass/for-destruct.rs
2012-07-01 19:19:32 -07:00

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);
}
}