From fcfe66875f46e8652170fd190416d796ae30aabc Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 20 Jun 2026 01:54:57 +0800 Subject: Remove all explicit program name modes from macros --- mingling_macros/src/renderer.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'mingling_macros/src/renderer.rs') 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 { #[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( -- cgit