Crates.io | clonelet |
lib.rs | clonelet |
version | 0.2.0 |
source | src |
created_at | 2023-07-30 12:29:40.401829 |
updated_at | 2023-07-30 17:43:47.462901 |
description | A simple macro to capture by clone in closures |
homepage | https://github.com/simon-bourne/clonelet |
repository | https://github.com/simon-bourne/clonelet |
max_upload_size | |
id | 929936 |
size | 5,854 |
A simple macro to capture by clone
in closures. Your closure doesn't need to live inside a macro.
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 || {}
};