Rust 50 🦀 Moving Environment Variables into Closures (move keyword)
A closure captures the variables it uses from the surrounding scope. By default, the compiler infers the least restrictive capture: an immutable borrow if the closure only reads the variable, a mutable borrow if it modifies it, and a move if the closure takes ownership. The inference is convenient for the closures that are called…