rust/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs

7 lines
174 B
Rust
Raw Normal View History

2011-12-29 09:49:33 -08:00
fn main() {
2012-01-23 14:59:00 -08:00
fn f(i: fn() -> uint) -> uint { i() }
let v = ~[-1f, 0f, 1f, 2f, 3f];
let z = do do vec::foldl(f, v) { |x, _y| x } { || 22u };
2011-12-29 09:49:33 -08:00
assert z == 22u;
}