From 05d07bbc627b59fd07a8764a972b4aac63a46f53 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 16 May 2026 22:17:38 +0800 Subject: Use `default_program_path()` instead of `default_program_ident()` --- mingling_macros/src/dispatcher.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mingling_macros/src/dispatcher.rs') diff --git a/mingling_macros/src/dispatcher.rs b/mingling_macros/src/dispatcher.rs index 64f0339..a74db6d 100644 --- a/mingling_macros/src/dispatcher.rs +++ b/mingling_macros/src/dispatcher.rs @@ -109,6 +109,11 @@ pub fn dispatcher(input: TokenStream) -> TokenStream { } else { group_name.clone() }; + let program_path = if use_default { + crate::default_program_path() + } else { + quote! { #group_name } + }; quote! { #[derive(Debug, Default)] @@ -119,14 +124,14 @@ pub fn dispatcher(input: TokenStream) -> TokenStream { #comp_entry #dispatch_tree_entry - impl ::mingling::Dispatcher<#program_ident> for #command_struct { + impl ::mingling::Dispatcher<#program_path> for #command_struct { fn node(&self) -> ::mingling::Node { ::mingling::macros::node!(#command_name_str) } - fn begin(&self, args: Vec) -> ::mingling::ChainProcess<#program_ident> { + fn begin(&self, args: Vec) -> ::mingling::ChainProcess<#program_path> { #pack::new(args).to_chain() } - fn clone_dispatcher(&self) -> Box> { + fn clone_dispatcher(&self) -> Box> { Box::new(#command_struct) } } -- cgit