From a8c8d50b6c59b103da7fd4bbb5e7ca3ff7b2f49a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 10 Jul 2026 16:42:31 +0800 Subject: docs: fix trailing whitespace in markdown files --- docs/dev/pages/issues/remove-r-print-macro.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/dev/pages/issues/remove-r-print-macro.md') diff --git a/docs/dev/pages/issues/remove-r-print-macro.md b/docs/dev/pages/issues/remove-r-print-macro.md index 53fa086..96f99ef 100644 --- a/docs/dev/pages/issues/remove-r-print-macro.md +++ b/docs/dev/pages/issues/remove-r-print-macro.md @@ -20,7 +20,7 @@ macro_rules! my_println { r_println!("Custom: {}", format!($($arg)*)); }; } - + #[renderer] fn render_something(_p: ResultSomething) { // Although this function body has __renderer_inner_result injected, @@ -34,7 +34,7 @@ fn render_something(_p: ResultSomething) { my_println!("{}", box_val); // Compile error: cannot find __renderer_inner_result } ``` - + ## Deeper Issues I have to admit, this is an early design flaw. After re-examining the code, I found the problem goes beyond "can't be wrapped". @@ -58,11 +58,11 @@ fn render_something(prev: ResultSomething) -> RenderResult { result.println(prev.to_string()); // or write!(result, "{}", prev.to_string()); - + result // return here } ``` - + Clear boundaries — the entire rendering process is confined within the function body decorated by `#[help]` or `#[renderer]`, without introducing extra out-of-scope dependencies. The trade-off is slightly more boilerplate compared to the original approach. ### Option 2: Resource Injection @@ -73,11 +73,11 @@ fn render_something(prev: ResultSomething, result: &mut ResRenderResult) { result.println(prev.to_string()); // or write!(result, "{}", prev.to_string()); - + result // return here } ``` - + More flexible, but blurs the boundary between logic functions like `#[chain]` and rendering functions like `#[help]`. ### Preferred Direction -- cgit