rust/src/test/run-pass/auto-loop.rs
Niko Matsakis 9cf271fe96 De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other
vec routines.
2012-09-19 10:52:59 -07:00

8 lines
126 B
Rust

fn main() {
let mut sum = 0;
for vec::each(~[1, 2, 3, 4, 5]) |x| {
sum += *x;
}
assert (sum == 15);
}