From c48149a86eafcca967ef9aa947864fb4d0c727ea Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 16 May 2026 22:08:39 +0800 Subject: Replace hardcoded `ThisProgram` ident with shared constant --- mingling_macros/src/dispatcher.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mingling_macros/src/dispatcher.rs') diff --git a/mingling_macros/src/dispatcher.rs b/mingling_macros/src/dispatcher.rs index 915f5db..64f0339 100644 --- a/mingling_macros/src/dispatcher.rs +++ b/mingling_macros/src/dispatcher.rs @@ -11,6 +11,7 @@ use syn::{Ident, Result as SynResult, Token}; #[cfg(feature = "dispatch_tree")] use crate::COMPILE_TIME_DISPATCHERS; +use crate::DEFAULT_PROGRAM_NAME; enum DispatcherChainInput { Explicit { @@ -88,7 +89,7 @@ pub fn dispatcher(input: TokenStream) -> TokenStream { command_struct, pack, } => ( - Ident::new("ThisProgram", proc_macro2::Span::call_site()), + Ident::new(DEFAULT_PROGRAM_NAME, proc_macro2::Span::call_site()), command_name, command_struct, pack, @@ -104,7 +105,7 @@ pub fn dispatcher(input: TokenStream) -> TokenStream { let expanded = { let program_ident = if use_default { - Ident::new("ThisProgram", proc_macro2::Span::call_site()) + Ident::new(DEFAULT_PROGRAM_NAME, proc_macro2::Span::call_site()) } else { group_name.clone() }; -- cgit