3 ms·
Parent is saying that you can declare your closure 'move' and move references rather than values, therefore getting the mixed behavior you described. You don't
by remram 5y ago
Parent is saying that you can declare your closure 'move' and move references rather than values, therefore getting the mixed behavior you described. You don't have to move all values.
- pjmlp 5y agoIf you want to copy in such cases in Rust, you need to copy to dummy variables that are then moved into the closure, a common pattern in Gtk-rs that even deserves a macro to simplify the boilerplate.