3 ms·
I am 99% sure this is identical: let on_heap = Box::new(...); let shared = Arc::new(...); let s = shared.clone(); function_that_accepts_lambda
by steveklabnik 11y ago
I am 99% sure this is identical:
let on_heap = Box::new(...);
let shared = Arc::new(...);
let s = shared.clone();
function_that_accepts_lambda(move || {
on_heap.bar();
s.foo();
});
We have to make the extra s binding.
Also, my sibling is correct that Copy types will just be copied, not moved.