summaryrefslogtreecommitdiff
path: root/macros/src/util.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-03-18 17:14:42 +0100
committerHampusM <hampus@hampusmat.com>2023-03-18 17:15:30 +0100
commitc48271aef7e6b0819c497f302127c161845a83d7 (patch)
treea18d7b5fc8e017b4b7e0917a55534b28a01fe57d /macros/src/util.rs
parent2ca8017deebe7bfe5aac368aead777a2c4910ca2 (diff)
refactor: rewrite the mock macro as a procedural macro
Diffstat (limited to 'macros/src/util.rs')
-rw-r--r--macros/src/util.rs22
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;