From 57c53affe3542cb6bd4e79ee4c18f20a1bd76b2d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 17 Aug 2026 05:49:19 +0800 Subject: refactor!: replace pack! macros with derive-based pipeline types Remove the `pack!`, `pack_err!`, `pack_structural!`, and `pack_err_structural!` macros, replacing all pipeline type definitions with `#[derive(Grouped)]` and `#[derive(Grouped, Wrap)]` attributes. This changes the generated struct shape from named-field structs with an `inner` field to tuple structs accessed via `.0`, and removes the auto-generated `name` and `info` fields from error types. --- mingling/src/gen_program.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'mingling/src/gen_program.rs') diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs index 2c476a2..ed60668 100644 --- a/mingling/src/gen_program.rs +++ b/mingling/src/gen_program.rs @@ -12,7 +12,7 @@ pub type Next = ChainProcess; /// The generic program entry point. /// -/// This type is created by the `pack!` macro as a variant of the +/// This type is generated by the `gen_program!` macro as a variant of the /// program's output type set (`ThisProgram`). pub struct Entry { /// The arguments provided by the user @@ -41,7 +41,7 @@ pub enum ThisProgram { /// A struct representing a "renderer not found" error. /// -/// This type is created by the `pack!` macro as a variant of the +/// This type is generated by the `gen_program!` macro as a variant of the /// program's output type set (`ThisProgram`). pub struct ErrorRendererNotFound { /// The name of the renderer that was not found @@ -50,7 +50,7 @@ pub struct ErrorRendererNotFound { /// A struct representing a "dispatcher not found" error. /// -/// This type is created by the `pack!` macro as a variant of the +/// This type is generated by the `gen_program!` macro as a variant of the /// program's output type set (`ThisProgram`). pub struct EntryFallback { /// The arguments provided by the user @@ -61,8 +61,6 @@ pub struct EntryFallback { pub struct ResultEmpty; /// A dispatcher representing the subcommand `__comp` itself. -/// -/// **You can register it using `with_dispatcher`.** #[cfg(feature = "comp")] pub struct CMDCompletion; @@ -71,7 +69,7 @@ pub struct CMDCompletion; /// This struct holds the raw command-line arguments that were passed to the `__comp` /// subcommand, which will be used to compute completion suggestions. /// -/// This type is created by the `pack!` macro as a variant of the +/// This type is generated by the `gen_program!` macro as a variant of the /// program's output type set (`ThisProgram`). #[cfg(feature = "comp")] pub struct CompletionContext { @@ -85,7 +83,7 @@ pub struct CompletionContext { /// which together provide the information needed to render completion candidates /// to the user's shell. /// -/// This type is created by the `pack!` macro as a variant of the +/// This type is generated by the `gen_program!` macro as a variant of the /// program's output type set (`ThisProgram`). #[cfg(feature = "comp")] pub struct CompletionSuggest { -- cgit