r4cppp icon indicating copy to clipboard operation
r4cppp copied to clipboard

The captured values are moved when the closure is called, not when it's constructed

Open aaronmcdaid opened this issue 4 years ago • 5 comments

WARNING I'm a n00b to Rust, so this is likely incorrect! Please review carefully, and apologies if this is incorrect 😀.

While closures can capture some environment by moving, it's not entirely clear to me when this happens. I guess it happens when the closure is called, not when the closure is created.

Hence, I'm proposing to add a few words. I don't think this is made entirely clear elsewhere in the document.

aaronmcdaid avatar Nov 17 '21 14:11 aaronmcdaid