diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-11 14:44:17 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-11 14:44:17 +0800 |
| commit | c5736152b0adeef17349265c4b9277ba17b8bcfd (patch) | |
| tree | a5a5227ef4ca20ec09d1c8cf0655e9f9f33e03b6 /mingling_core/src/program/collection.rs | |
| parent | c08b2d608abe134e37bc4dee7df2113fac968e06 (diff) | |
feat: require renderers to return RenderResult instead of mutating one
BREAKING CHANGE: The `render` method on `Renderer`, `HelpRequest`, and
`ProgramCollect` now returns `RenderResult` instead of taking
`&mut RenderResult`. The `r_print!` and `r_println!` macros have been
removed in favor of using `std::io::Write` directly on `RenderResult`.
Diffstat (limited to 'mingling_core/src/program/collection.rs')
| -rw-r--r-- | mingling_core/src/program/collection.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mingling_core/src/program/collection.rs b/mingling_core/src/program/collection.rs index 044379c..cbb9363 100644 --- a/mingling_core/src/program/collection.rs +++ b/mingling_core/src/program/collection.rs @@ -7,7 +7,7 @@ use crate::Dispatcher; use crate::{AnyOutput, ChainProcess, Groupped, RenderResult}; #[cfg(feature = "structural_renderer")] -use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError}; +use crate::{error::StructuralRendererSerializeError, StructuralRendererSetting}; #[cfg(feature = "comp")] use crate::{ShellContext, Suggest}; @@ -53,10 +53,10 @@ pub trait ProgramCollect { fn build_empty_result() -> AnyOutput<Self::Enum>; /// Render the input [`AnyOutput`](./struct.AnyOutput.html) - fn render(any: AnyOutput<Self::Enum>, r: &mut RenderResult); + fn render(any: AnyOutput<Self::Enum>) -> RenderResult; /// Render help for Entry - fn render_help(any: AnyOutput<Self::Enum>, r: &mut RenderResult); + fn render_help(any: AnyOutput<Self::Enum>) -> RenderResult; /// Find a matching chain to continue execution based on the input [AnyOutput](./struct.AnyOutput.html), returning a new [AnyOutput](./struct.AnyOutput.html) #[cfg(feature = "async")] |
