rust/src/test/run-pass/for-each-destruct.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

9 lines
193 B
Rust

iter x() -> {x: int, y: int} {
let i = 0;
while i < 40 { put {x: i, y: 30 - i}; i += 10; }
}
fn main() {
for each {x: x, y: y}: {x: int, y: int} in x() { assert (x + y == 30); }
}