nandi/rustnimpublic Fork 0
afb2a6e152356d5a78d536ad75f005bb1fc7ed63
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add closures and unsafe; base16ct's lower.rs and upper.rs go through 0a375d8 · on afb2a6e152356d5a78d536ad75f005bb1fc7ed63 · nandithebull · 13h ago
904-reject-move-closure.rs · 9 lines · 298 BRust Blame HistoryRaw
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());
}