feat: Pipe
This commit is contained in:
13
macro/src/macros.rs
Normal file
13
macro/src/macros.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
macro_rules! enum_to_tokens {
|
||||
($enum:ident: $($variant:ident),*) => {
|
||||
impl ToTokens for $enum {
|
||||
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
|
||||
tokens.extend(match self {
|
||||
$(Self::$variant(variant) => quote! { #variant },)*
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use enum_to_tokens;
|
||||
Reference in New Issue
Block a user