aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/dispatcher.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-16 22:08:39 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-16 22:08:39 +0800
commitc48149a86eafcca967ef9aa947864fb4d0c727ea (patch)
treec794eaef4435cb0f4ec8524861ebf3165f660097 /mingling_macros/src/dispatcher.rs
parent5fe400c006d9d143aa7b977cb13f95e7380754a5 (diff)
Replace hardcoded `ThisProgram` ident with shared constant
Diffstat (limited to 'mingling_macros/src/dispatcher.rs')
-rw-r--r--mingling_macros/src/dispatcher.rs5
1 files changed, 3 insertions, 2 deletions
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()
};