diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-20 09:50:28 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-20 09:50:28 +0800 |
| commit | c385dcf15930d2754b68c2794986ad30fc65c141 (patch) | |
| tree | 2fed45ade07d96d195b9f9a35a1de0aeda11ee5e /GETTING_STARTED.md | |
| parent | 7b3a1d7fd9f60b91a7f9602374c081882d46facc (diff) | |
docs: migrate renderer examples to buffer macro and update docs
Update all documentation and code examples to use the new
`#[renderer(buffer)]`
pattern with `r_println!` instead of manually constructing
`RenderResult`
with `writeln!`.
Diffstat (limited to 'GETTING_STARTED.md')
| -rw-r--r-- | GETTING_STARTED.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index bb2175f..1aad8d5 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -577,6 +577,7 @@ With the `structural_renderer` feature, users can add `--json` or `--yaml` flags // serde = "1" use mingling::prelude::*; +use mingling::macros::buffer; use mingling::setup::picker::StructuralRendererSetup; use mingling::Grouped; use mingling::StructuralData; @@ -600,11 +601,9 @@ fn render_info(args: EntryRender) -> Next { ResultInfo { name, age }.to_chain() } -#[renderer] -fn render_info_result(info: ResultInfo) -> RenderResult { - let mut result = RenderResult::new(); - writeln!(result, "{} is {} years old", info.name, info.age).ok(); - result +#[renderer(buffer)] +fn render_info_result(info: ResultInfo) { + r_println!("{} is {} years old", info.name, info.age); } fn main() { |
