diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-18 17:14:42 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-18 17:15:30 +0100 |
commit | c48271aef7e6b0819c497f302127c161845a83d7 (patch) | |
tree | a18d7b5fc8e017b4b7e0917a55534b28a01fe57d /macros/src/util.rs | |
parent | 2ca8017deebe7bfe5aac368aead777a2c4910ca2 (diff) |
refactor: rewrite the mock macro as a procedural macro
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; |