quote2
An alternative lightweight version of quote.
Features
-
Very lightweight and produces extremely lean, minimal code compare to
quote -
Unlike
quote,quote2allows direct mutation of tokens without creating newTokenStreaminstances, enhancing runtime performance.similar to write macro.
Example
Add it as a dependency to your Rust project by adding the following line to your
Cargo.toml file:
[]
= "0.9"
use ;
let body = quote;
let mut t = new;
quote!;
Generated code: