diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-17 02:29:30 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-17 02:39:56 +0800 |
| commit | 6980fbf2f9fb4c599d8dc6ff549a8b3288eb24e9 (patch) | |
| tree | bc7049698955d7a40706ea691fd5bab526a6b5e5 /mingling_macros/src/attr/command.rs | |
| parent | 4c191b2b46a67a0dda6e9a867b40f45156af4f9c (diff) | |
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).
Diffstat (limited to 'mingling_macros/src/attr/command.rs')
| -rw-r--r-- | mingling_macros/src/attr/command.rs | 9 |
1 files changed, 3 insertions, 6 deletions
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; |
