Comment on A guide to closures in RustparentComments−throwaway8943453yIt becomes more painful when the closure is actually closing over something (especially if that thing is mutable), since the borrow checker gets involved.−bsder3yThis 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.
Comments
It becomes more painful when the closure is actually closing over something (especially if that thing is mutable), since the borrow checker gets involved.
This 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.