From f3d6f76dfd07c35dabc11aa86d86c3671cd283c5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 1 Apr 2026 08:11:01 +0800 Subject: Rename chain_struct to pack in dispatcher macros --- mingling_macros/src/dispatcher_chain.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mingling_macros/src/dispatcher_chain.rs b/mingling_macros/src/dispatcher_chain.rs index d9d95a5..57c11a3 100644 --- a/mingling_macros/src/dispatcher_chain.rs +++ b/mingling_macros/src/dispatcher_chain.rs @@ -12,7 +12,7 @@ use syn::{Ident, Result as SynResult, Token}; struct DispatcherChainInput { command_name: syn::LitStr, command_struct: Ident, - chain_struct: Ident, + pack: Ident, } impl Parse for DispatcherChainInput { @@ -21,12 +21,12 @@ impl Parse for DispatcherChainInput { input.parse::()?; let command_struct = input.parse()?; input.parse::]>()?; - let chain_struct = input.parse()?; + let pack = input.parse()?; Ok(DispatcherChainInput { command_name, command_struct, - chain_struct, + pack, }) } } @@ -35,7 +35,7 @@ pub fn dispatcher_chain(input: TokenStream) -> TokenStream { let DispatcherChainInput { command_name, command_struct, - chain_struct, + pack, } = syn::parse_macro_input!(input as DispatcherChainInput); let command_name_str = command_name.value(); @@ -44,14 +44,14 @@ pub fn dispatcher_chain(input: TokenStream) -> TokenStream { #[derive(Debug, Default)] pub struct #command_struct; - ::mingling::macros::chain_struct!(#chain_struct = Vec); + ::mingling::macros::pack!(#pack = Vec); impl ::mingling::Dispatcher for #command_struct { fn node(&self) -> ::mingling::Node { ::mingling::macros::node!(#command_name_str) } fn begin(&self, args: Vec) -> ::mingling::ChainProcess { - #chain_struct::new(args).to_chain() + #pack::new(args).to_chain() } fn clone_dispatcher(&self) -> Box { Box::new(#command_struct) @@ -66,7 +66,7 @@ pub fn dispatcher_render(input: TokenStream) -> TokenStream { let DispatcherChainInput { command_name, command_struct, - chain_struct, + pack, } = syn::parse_macro_input!(input as DispatcherChainInput); let command_name_str = command_name.value(); @@ -75,14 +75,14 @@ pub fn dispatcher_render(input: TokenStream) -> TokenStream { #[derive(Debug, Default)] pub struct #command_struct; - ::mingling::macros::chain_struct!(#chain_struct = Vec); + ::mingling::macros::pack!(#pack = Vec); impl ::mingling::Dispatcher for #command_struct { fn node(&self) -> ::mingling::Node { ::mingling::macros::node!(#command_name_str) } fn begin(&self, args: Vec) -> ::mingling::ChainProcess { - #chain_struct::new(args).to_render() + #pack::new(args).to_render() } fn clone_dispatcher(&self) -> Box { Box::new(#command_struct) -- cgit