From 9c8f5c8d60f3066fec8a1573aa3f5673e0b2ecb8 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 3 Aug 2026 13:36:13 +0800 Subject: chore!: rename ErrorDispatcherNotFound to EntryFallback Rename the internal fallback type and its associated `ProgramCollect` plumbing from `ErrorDispatcherNotFound`/`build_dispatcher_not_found` to `EntryFallback`/`build_entry_fallback`, along with the generated enum variant and pack type. Update all documentation, examples, and tests accordingly. --- mingling_macros/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling_macros/src/lib.rs') diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs index b6656da..c955e36 100644 --- a/mingling_macros/src/lib.rs +++ b/mingling_macros/src/lib.rs @@ -36,7 +36,7 @@ //! │ V │ //! │ Reads all registries → generates ThisProgram with: │ //! │ • ProgramCollect impl (dispatch/render/chain dispatch tree) │ -//! │ • Fallback types (ErrorDispatcherNotFound, etc.) │ +//! │ • Fallback types (EntryFallback, etc.) │ //! │ • Completion logic (if `comp` feature enabled) │ //! └──────────────────────────────────────────────────────────────────┘ //! ``` @@ -120,8 +120,8 @@ //! ```rust,ignore //! // Example of what gen_program! generates (simplified): //! impl ProgramCollect for ThisProgram { -//! fn build_dispatcher_not_found(args: Vec) -> AnyOutput { -//! AnyOutput::new(ErrorDispatcherNotFound::new(args)) +//! fn build_entry_fallback(args: Vec) -> AnyOutput { +//! AnyOutput::new(EntryFallback::new(args)) //! } //! fn has_chain(any: &AnyOutput) -> bool { //! match any.member_id() { @@ -978,11 +978,11 @@ pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream { /// The macros `gen_program!` automatically generates two fallback types that /// you can provide renderers for: /// - `ErrorRendererNotFound` — triggered when no matching renderer is found -/// - `ErrorDispatcherNotFound` — triggered when no matching dispatcher is found +/// - `EntryFallback` — triggered when no matching dispatcher is found /// /// ```rust,ignore /// #[renderer] -/// fn fallback_dispatcher_not_found(prev: ErrorDispatcherNotFound) -> RenderResult { +/// fn fallback_dispatcher_not_found(prev: EntryFallback) -> RenderResult { /// let mut result = RenderResult::new(); /// writeln!(result, "Unknown command: {}", prev.join(", ")); /// result @@ -1819,7 +1819,7 @@ pub fn derive_grouped_serialize(input: TokenStream) -> TokenStream { /// 1. **`pub type Next = ChainProcess`** — A convenience type alias /// for use in chain function return types. /// 2. **`program_comp_gen!(...)`** (with `comp` feature) — Generates completion infrastructure. -/// 3. **`program_fallback_gen!(...)`** — Generates `ErrorRendererNotFound` and `ErrorDispatcherNotFound` types. +/// 3. **`program_fallback_gen!(...)`** — Generates `ErrorRendererNotFound` and `EntryFallback` types. /// 4. **`program_final_gen!(...)`** — Generates the program enum with: /// - An enum with all packed types as variants /// - `Display` implementation for the enum -- cgit