4 ms·
It becomes more painful when the closure is actually closing over something (especially if that thing is mutable), since the borrow checker gets involved.
by throwaway894345 3y ago
It becomes more painful when the closure is actually closing over something (especially if that thing is mutable), since the borrow checker gets involved.
- bsder 3y agoThis is a key thing to know, actually. Closures in Rust are different from named functions and that can trip you up. Closures in Rust also close over lifetime information in ways that named functions cannot do. This confused me for quite a while.