clonelet

Crates.ioclonelet
lib.rsclonelet
version0.2.0
sourcesrc
created_at2023-07-30 12:29:40.401829
updated_at2023-07-30 17:43:47.462901
descriptionA simple macro to capture by clone in closures
homepagehttps://github.com/simon-bourne/clonelet
repositoryhttps://github.com/simon-bourne/clonelet
max_upload_size
id929936
size5,854
Simon Bourne (simon-bourne)

documentation

README

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 || {}
};
Commit count: 3

cargo fmt