rust/src/test/run-pass/auto-loop.rs

6 lines
113 B
Rust
Raw Normal View History

fn main() {
let mut sum = 0;
2012-06-30 18:19:07 -05:00
for vec::each(~[1, 2, 3, 4, 5]) |x| { sum += x; }
2011-07-27 07:19:39 -05:00
assert (sum == 15);
}