diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-29 01:18:25 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-29 01:18:25 +0800 |
| commit | 7809a8cbfbaf41fcc81de980c903e11f08bd1b12 (patch) | |
| tree | 1ae5d274530fa73af768146b955d183b94eb2a0a /mingling_macros/src/node.rs | |
| parent | db9afa0b06355028eafe3bc29fe0b2429ba8fd0a (diff) | |
Generate struct names from function names in chain and renderer macros
Diffstat (limited to 'mingling_macros/src/node.rs')
| -rw-r--r-- | mingling_macros/src/node.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mingling_macros/src/node.rs b/mingling_macros/src/node.rs index e56f14b..8cb88d3 100644 --- a/mingling_macros/src/node.rs +++ b/mingling_macros/src/node.rs @@ -28,6 +28,14 @@ pub fn node(input: TokenStream) -> TokenStream { let input_parsed = syn::parse_macro_input!(input as NodeInput); let path_str = input_parsed.path.value(); + // If the input string is empty, return an empty Node + if path_str.is_empty() { + return quote! { + mingling::Node::default() + } + .into(); + } + // Split the path by dots let parts: Vec<String> = path_str .split('.') |
