aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/dispatcher.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-16 22:17:38 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-16 22:17:38 +0800
commit05d07bbc627b59fd07a8764a972b4aac63a46f53 (patch)
tree3ac865155220ce798964f1e0c95575e6dc0c5e9f /mingling_macros/src/dispatcher.rs
parentc48149a86eafcca967ef9aa947864fb4d0c727ea (diff)
Use `default_program_path()` instead of `default_program_ident()`
Diffstat (limited to 'mingling_macros/src/dispatcher.rs')
-rw-r--r--mingling_macros/src/dispatcher.rs11
1 files changed, 8 insertions, 3 deletions
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<String>) -> ::mingling::ChainProcess<#program_ident> {
+ fn begin(&self, args: Vec<String>) -> ::mingling::ChainProcess<#program_path> {
#pack::new(args).to_chain()
}
- fn clone_dispatcher(&self) -> Box<dyn ::mingling::Dispatcher<#program_ident>> {
+ fn clone_dispatcher(&self) -> Box<dyn ::mingling::Dispatcher<#program_path>> {
Box::new(#command_struct)
}
}