I have a general struct with settings and an extra variable setting that I want to tune and play around with.
For all possible values in an integer ra
The closure! macro gives the ability to selectively reference, move, or clone variables into a closure.
Example taken from the docs:
use closure::closure;
let string = "move".to_string();
let x = 10;
let mut y = 20;
let rc = Rc::new(5);
let closure = closure!(move string, ref x, ref mut y, clone rc, |arg: i32| {
...
});
Variables that are captured but not listed default to being moved.