8 releases (stable)
| 1.1.2 | Apr 15, 2025 |
|---|---|
| 1.1.1 | Nov 11, 2024 |
| 1.1.0 | Aug 17, 2023 |
| 1.0.3 | Aug 16, 2023 |
| 0.1.0 | Aug 16, 2023 |
#419 in Procedural macros
449 downloads per month
8KB
91 lines
clown
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), slip!(baz.bop))
into this:
{
let __honk_0 = (foo.bar).clone();
let __slip_0 = baz.bop;
move || do_call(__honk_0, __slip_0)
}
Dependencies
~0.6–1MB
~21K SLoC