From e1b8f6bc80c361070265484fcc442f7923523c1e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 20 Jun 2026 00:17:21 +0800 Subject: Move to_chain and to_render to Groupped trait --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dc1aa9..9875171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -195,6 +195,28 @@ use mingling::{res::ExitCode, REPL}; use mingling::{res::ResExitCode, res::ResREPL}; ``` +3. **\[core\]** **\[macros\]** Migrated `to_chain()` and `to_render()` methods from being generated individually per type by `#[derive(Groupped)]` and `pack!` macros, to being provided as default trait methods on the `Groupped` trait itself. + + Previously, each packed or derived type had its own inherent `to_chain()` and `to_render()` methods generated by the macros. Now, these methods are defined on the `Groupped` trait with default implementations, making them available to all types that implement the trait without redundant code generation. + + ```rust + // Before (generated per type by macros): + impl MyType { + pub fn to_chain(self) -> ChainProcess { + AnyOutput::new(self).route_chain() + } + pub fn to_render(self) -> ChainProcess { + AnyOutput::new(self).route_renderer() + } + } + + // After (provided by Groupped trait default methods): + // just ensure Groupped is implemented — to_chain() and to_render() + // are automatically available + ``` + + Removed the per-type inherent method generation from both `groupped.rs` and `pack.rs` in `mingling_macros`. + ### Release 0.1.9 (2026-05-29) #### Fixes: -- cgit