2 unstable releases
0.2.0 | Jul 30, 2023 |
---|---|
0.1.0 | Jul 30, 2023 |
#2475 in Rust patterns
71 downloads per month
Used in 7 crates
(3 directly)
5KB
91 lines
Clonelet
A simple macro to capture by clone
in closures. Your closure doesn't need to live inside a macro.
Example
let closure = {
clone!(x, y, mut z);
move || {}
};
Generates:
let closure = {
let x = x.clone();
let y = y.clone();
let mut z = z.clone();
move || {}
};