diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-09 15:13:38 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-09 15:13:38 +0800 |
| commit | 1b67e1143f367d00e955c2780dbdefab463836e1 (patch) | |
| tree | 41b93757bba91e2e0eb112d9b5bdb3dfbb3c4c36 /mingling_macros/src/dispatcher_chain.rs | |
| parent | 4764c3c818e3da16a3cba3b9877d9beb635e4237 (diff) | |
Rename DefaultProgram to ThisProgram and remove ThisProgram marker
Diffstat (limited to 'mingling_macros/src/dispatcher_chain.rs')
| -rw-r--r-- | mingling_macros/src/dispatcher_chain.rs | 18 |
1 files changed, 9 insertions, 9 deletions
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<String>); + ::mingling::macros::pack!(ThisProgram, #pack = Vec<String>); - impl ::mingling::Dispatcher<DefaultProgram> for #command_struct { + impl ::mingling::Dispatcher<ThisProgram> for #command_struct { fn node(&self) -> ::mingling::Node { ::mingling::macros::node!(#command_name_str) } - fn begin(&self, args: Vec<String>) -> ::mingling::ChainProcess<DefaultProgram> { + fn begin(&self, args: Vec<String>) -> ::mingling::ChainProcess<ThisProgram> { #pack::new(args).to_chain() } - fn clone_dispatcher(&self) -> Box<dyn ::mingling::Dispatcher<DefaultProgram>> { + fn clone_dispatcher(&self) -> Box<dyn ::mingling::Dispatcher<ThisProgram>> { 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<String>); + ::mingling::macros::pack!(ThisProgram, #pack = Vec<String>); impl ::mingling::Dispatcher for #command_struct { fn node(&self) -> ::mingling::Node { |
