2 ms·
Also common to set up "capture clauses" for lambdas as Rust does not have that in the language, IME most common with threads: spawn({ let a = a.clo
by masklinn 2y ago
Also common to set up "capture clauses" for lambdas as Rust does not have that in the language, IME most common with threads:
spawn({
let a = a.clone();
let b = &b;
move || {
// do something with the a you cloned and the b you borrowed
}
})