6 releases (stable)

1.1.0 Aug 17, 2023
1.0.3 Aug 16, 2023
0.1.0 Aug 16, 2023

#885 in Procedural macros

MIT license

6KB
70 lines

clown

Crate Info API Docs

An approximation of "capture-by-clone" lambdas in Rust.
Requires nightly and #![feature(proc_macro_hygiene, stmt_expr_attributes)]

Turns this:

#[clown] || do_call(honk!(foo.bar))

into this:

{
    let __honk_0 = (foo.bar).clone();
    move || do_call(__honk_0)
}

Dependencies

~0.7–1.2MB
~25K SLoC