From 6980fbf2f9fb4c599d8dc6ff549a8b3288eb24e9 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 17 Aug 2026 02:29:30 +0800 Subject: refactor!: remove dynamic dispatcher registration API Dispatchers are now always registered at compile time, removing the `with_dispatcher` / `with_dispatchers` methods and the `PathfinderConfig` API. The `dispatch_tree` feature now only controls the matching strategy (trie vs linear list). --- mingling_macros/src/attr/command.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mingling_macros/src/attr/command.rs') diff --git a/mingling_macros/src/attr/command.rs b/mingling_macros/src/attr/command.rs index c2ddde3..4542bd7 100644 --- a/mingling_macros/src/attr/command.rs +++ b/mingling_macros/src/attr/command.rs @@ -321,19 +321,16 @@ pub(crate) fn command_attr(attr: TokenStream, item: TokenStream) -> TokenStream fn_name.span(), ); - // dispatcher internal static (only exists with dispatch_tree feature) - #[cfg(feature = "dispatch_tree")] + // dispatcher internal static (always exists now that dispatchers are + // collected at compile time regardless of the `dispatch_tree` feature) let snaked_node = just_fmt::snake_case!(names.node_lit.value()); - #[cfg(feature = "dispatch_tree")] let dispatcher_internal = { let ident = Ident::new( - &format!("__internal_dispatcher_{}", snaked_node), + &format!("__internal_dispatcher_{snaked_node}"), fn_name.span(), ); quote! { #vis use super::#ident; } }; - #[cfg(not(feature = "dispatch_tree"))] - let dispatcher_internal = quote! {}; let cmd_name = &names.cmd_name; let entry_type = &names.entry_type; -- cgit