diff options
Diffstat (limited to 'macros/src/util.rs')
-rw-r--r-- | macros/src/util.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/macros/src/util.rs b/macros/src/util.rs new file mode 100644 index 0000000..363051f --- /dev/null +++ b/macros/src/util.rs @@ -0,0 +1,22 @@ +use syn::punctuated::Punctuated; +use syn::token::Paren; +use syn::TypeTuple; + +pub fn create_unit_type_tuple() -> TypeTuple +{ + TypeTuple { + paren_token: Paren::default(), + elems: Punctuated::new(), + } +} + +macro_rules! create_path { + ($($segment: ident)::+) => { + Path::new( + WithLeadingColons::No, + [$(PathSegment::new(format_ident!(stringify!($segment)), None))+], + ) + }; +} + +pub(crate) use create_path; |