diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-20 01:54:57 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-20 01:54:57 +0800 |
| commit | fcfe66875f46e8652170fd190416d796ae30aabc (patch) | |
| tree | 2af968ac8cabcb06337e36c35133313781cd1071 /mingling_macros/src/renderer.rs | |
| parent | 78330940bd0fcab6ffbb8b930a1ae88d313a9437 (diff) | |
Remove all explicit program name modes from macrosremoved-shit
Diffstat (limited to 'mingling_macros/src/renderer.rs')
| -rw-r--r-- | mingling_macros/src/renderer.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/mingling_macros/src/renderer.rs b/mingling_macros/src/renderer.rs index 4cf9fc1..ac82799 100644 --- a/mingling_macros/src/renderer.rs +++ b/mingling_macros/src/renderer.rs @@ -23,8 +23,9 @@ fn extract_return_type(sig: &Signature) -> Option<syn::Type> { #[allow(clippy::too_many_lines)] pub fn renderer_attr(attr: TokenStream, item: TokenStream) -> TokenStream { - // Parse attribute arguments for program path (e.g. #[renderer(my_crate::Program)]) - let (program_path, _use_crate_prefix) = parse_renderer_attr_args(attr); + // #[renderer] takes no arguments; always use the default program path + let _ = attr; + let program_path = crate::default_program_path(); let program_type = &program_path; // Parse the function item @@ -167,15 +168,6 @@ pub fn renderer_attr(attr: TokenStream, item: TokenStream) -> TokenStream { expanded.into() } -fn parse_renderer_attr_args(attr: TokenStream) -> (proc_macro2::TokenStream, bool) { - if attr.is_empty() { - (crate::default_program_path(), true) - } else { - let path: syn::Path = - syn::parse(attr).expect("Expected a path argument for #[renderer(path)]"); - (quote! { #path }, false) - } -} /// Builds the renderer entry for the global renderers list pub fn build_renderer_entry( |
