From 287d45e32b9bdeaaf58b70ebb9a27335f74c529d Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sun, 17 May 2026 22:59:15 +0800 Subject: Add no-return-value mode for `#[chain]` macro --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index cce00fe..4b0c3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,6 +111,22 @@ this::().modify_res::(|code| { 12. **\[core\]** Added panic catch for program execution. 13. **\[core\]** Added the `stdout_setting.silence_panic` option, which is disabled by default. When enabled, `Program`'s `panic!` will not output to the console +14. **\[macros\]** `#[chain]` now supports a no-return-value mode, which will automatically return `crate::EmptyResult::new(()).to_chain()` + +```rust +#[chain] +fn my_chain(prev: Prev) { + // Do something +} + +// Equivalent to +#[chain] +fn my_chain(prev: Prev) -> Next { + // Do something + crate::EmptyResult::new(()).to_chain() +} +``` + #### **BREAKING CHANGES**: 1. **\[core\]** The signature of `exec` has been changed to `exec(self) -> i32` (previously was `exec(self)`) -- cgit