diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-22 08:17:20 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-22 08:17:20 +0800 |
| commit | 7eed97fe690f214eba43b4784bc2dee3a71a1498 (patch) | |
| tree | c8e8b3547d4169a5afa4f6ffee9df3d46d98de4f /CHANGELOG.md | |
| parent | 6f46fbfd287e1be36e9364d6da40c26c549af5fc (diff) | |
Support custom return types in `#[renderer]` macro
Diffstat (limited to 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 354c8fe..e1dd0e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,11 @@ fn handle_path_pick(prev: PathPick) { } ``` +3. **\[macros\]** Extended the `#[renderer]` attribute to support custom return types. Previously, `#[renderer]` functions could only return `()`, and the generated helper function always returned `RenderResult`. Now: + + - **`fn foo(x: T)` / `fn foo(x: T) -> ()`** → The generated helper function returns `()`. If the internal `RenderResult` (`dummy_r`) is non-empty, it is automatically printed to stdout. + - **`fn foo(x: T) -> U`** → The generated helper function returns `U`. The internal `RenderResult` is converted via `dummy_r.into()`, and no automatic printing occurs. + #### **BREAKING CHANGES** (API CHANGES): 1. **\[core\]** Panic Unwind will not be supported when the `async` feature is enabled 2. **\[core\]** `modify_res` signature changed: now returns `Return` instead of `()` |
