1
2
3
4
5
6
7
8
9
|
//@ reject: captures by value
// Nim's closures capture by reference, as Rust's non-`move` closures do. A
// `move` closure is a different thing, so it is not lowered to the same
// construct.
fn main() {
let v: Vec<i32> = vec![1, 2, 3];
let f = move || v.len();
println!("{}", f());
}
|