diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-17 22:59:15 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-17 22:59:15 +0800 |
| commit | 287d45e32b9bdeaaf58b70ebb9a27335f74c529d (patch) | |
| tree | 3d2b9f3625224380de12bf84c068ba8db384d85b /CHANGELOG.md | |
| parent | ab3f173115fce8cd769c6f513560da8a57bc8df6 (diff) | |
Add no-return-value mode for `#[chain]` macro
Diffstat (limited to 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cce00fe..4b0c3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,6 +111,22 @@ this::<ThisProgram>().modify_res::<ExitCode>(|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)`) |
