From 1b67e1143f367d00e955c2780dbdefab463836e1 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 9 Apr 2026 15:13:38 +0800 Subject: Rename DefaultProgram to ThisProgram and remove ThisProgram marker --- mingling_macros/src/dispatcher_chain.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mingling_macros/src/dispatcher_chain.rs') diff --git a/mingling_macros/src/dispatcher_chain.rs b/mingling_macros/src/dispatcher_chain.rs index dc02c33..f531424 100644 --- a/mingling_macros/src/dispatcher_chain.rs +++ b/mingling_macros/src/dispatcher_chain.rs @@ -77,7 +77,7 @@ pub fn dispatcher_chain(input: TokenStream) -> TokenStream { command_struct, pack, } => ( - Ident::new("DefaultProgram", proc_macro2::Span::call_site()), + Ident::new("ThisProgram", proc_macro2::Span::call_site()), command_name, command_struct, pack, @@ -88,21 +88,21 @@ pub fn dispatcher_chain(input: TokenStream) -> TokenStream { let command_name_str = command_name.value(); let expanded = if use_default { - // For default case, use DefaultProgram + // For default case, use ThisProgram quote! { #[derive(Debug, Default)] pub struct #command_struct; - ::mingling::macros::pack!(DefaultProgram, #pack = Vec); + ::mingling::macros::pack!(ThisProgram, #pack = Vec); - impl ::mingling::Dispatcher for #command_struct { + impl ::mingling::Dispatcher for #command_struct { fn node(&self) -> ::mingling::Node { ::mingling::macros::node!(#command_name_str) } - fn begin(&self, args: Vec) -> ::mingling::ChainProcess { + fn begin(&self, args: Vec) -> ::mingling::ChainProcess { #pack::new(args).to_chain() } - fn clone_dispatcher(&self) -> Box> { + fn clone_dispatcher(&self) -> Box> { Box::new(#command_struct) } } @@ -149,7 +149,7 @@ pub fn dispatcher_render(input: TokenStream) -> TokenStream { command_struct, pack, } => ( - Ident::new("DefaultProgram", proc_macro2::Span::call_site()), + Ident::new("ThisProgram", proc_macro2::Span::call_site()), command_name, command_struct, pack, @@ -160,12 +160,12 @@ pub fn dispatcher_render(input: TokenStream) -> TokenStream { let command_name_str = command_name.value(); let expanded = if use_default { - // For default case, use DefaultProgram + // For default case, use ThisProgram quote! { #[derive(Debug, Default)] pub struct #command_struct; - ::mingling::macros::pack!(DefaultProgram, #pack = Vec); + ::mingling::macros::pack!(ThisProgram, #pack = Vec); impl ::mingling::Dispatcher for #command_struct { fn node(&self) -> ::mingling::Node { -- cgit