From 443ffe86485519a218997955335cde142733f88f Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 22 Jun 2026 23:59:31 +0800 Subject: Make route! macro auto-convert error types `route!()` now calls `Groupped::to_chain()` on the error branch, removing the need for callers to pre-convert with `.to_chain()` or `.to_render()`. --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 5384b45..b9b7bd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -278,6 +278,16 @@ use mingling::{res::ResExitCode, res::ResREPL}; Removed the per-type inherent method generation from both `groupped.rs` and `pack.rs` in `mingling_macros`. +4. **\[macros\]** Changed the `route!()` macro's error branch from `return e` to `return ::mingling::Groupped::to_chain(e)`, so that the error type no longer needs to be pre-converted to `ChainProcess` via `.to_chain()` or `.to_render()`. The macro now accepts any type implementing `Groupped` in the error position and automatically converts it. + +```rust +// Before +let value = route!(prev.pick_or_route((), Error::default().to_chain()).unpack()); + +// After +let value = route!(prev.pick_or_route((), Error::default()).unpack()); +``` + ### Release 0.1.9 (2026-05-29) #### Fixes: -- cgit