quote-alias

A helper macro for easily reusing static token streams

4 stable releases

1.0.3 Mar 6, 2024
1.0.2 Mar 5, 2024
1.0.1 Mar 4, 2024

#299 in Procedural macros

MIT/Apache

7KB

quote-alias

A helper macro for easily reusing static token streams.

Documentation


lib.rs:

The alias! macro can be used to assign token streams to convenient identifiers.

use quote::quote;
use quote_alias::alias;

alias! {
    Foo(my_crate::Foo),
}

// same as: quote! { my_crate::Foo::new() };
let create_foo = quote! { #Foo::new() };

See alias! for more detailed documentation and usage examples.

Dependencies

~78KB