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/src/gen_program.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling/src/gen_program.rs') diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs index aa0c4b5..a3b7e29 100644 --- a/mingling/src/gen_program.rs +++ b/mingling/src/gen_program.rs @@ -28,7 +28,7 @@ pub enum ThisProgram { /// Indicates that no matching renderer was found for the given output. ErrorRendererNotFound, /// Indicates that no matching dispatcher was found for the given arguments. - ErrorDispatcherNotFound, + EntryFallback, /// Indicates that the result is empty. ResultEmpty, /// Indicates the completion suggestions computed by the program for rendering. @@ -52,7 +52,7 @@ pub struct ErrorRendererNotFound { /// /// This type is created by the `pack!` macro as a variant of the /// program's output type set (`ThisProgram`). -pub struct ErrorDispatcherNotFound { +pub struct EntryFallback { /// The arguments provided by the user pub(crate) inner: Vec, } @@ -139,9 +139,9 @@ unsafe impl Grouped for ErrorRendererNotFound { // However, these are marked `unsafe` because the `Grouped` trait requires the // implementor to guarantee that the type is the only one associated with the // given enum variant — a guarantee that should be carefully verified in production code. -unsafe impl Grouped for ErrorDispatcherNotFound { +unsafe impl Grouped for EntryFallback { fn member_id() -> ThisProgram { - ThisProgram::ErrorDispatcherNotFound + ThisProgram::EntryFallback } } @@ -186,7 +186,7 @@ unsafe impl Grouped for CompletionSuggest { impl ProgramCollect for ThisProgram { type Enum = ThisProgram; - type ErrorDispatcherNotFound = ErrorDispatcherNotFound; + type EntryFallback = EntryFallback; type ErrorRendererNotFound = ErrorRendererNotFound; @@ -196,7 +196,7 @@ impl ProgramCollect for ThisProgram { todo!() } - fn build_dispatcher_not_found(_args: Vec) -> mingling_core::AnyOutput { + fn build_entry_fallback(_args: Vec) -> mingling_core::AnyOutput { todo!() } -- cgit