aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-26 01:05:02 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-26 01:05:02 +0800
commit00923e2a4180c39ccc2d0ab51a7548fb7bfa5719 (patch)
treea98b317d3cbc589d466a63b82a05c9664b60a73f /mingling_macros/src
parent94da1b889857e8f936335ebea50c62fcfb3b7c58 (diff)
Remove intermediate buffer in help output
Diffstat (limited to 'mingling_macros/src')
-rw-r--r--mingling_macros/src/dispatcher_clap.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/mingling_macros/src/dispatcher_clap.rs b/mingling_macros/src/dispatcher_clap.rs
index 8dd38af..765a448 100644
--- a/mingling_macros/src/dispatcher_clap.rs
+++ b/mingling_macros/src/dispatcher_clap.rs
@@ -241,12 +241,9 @@ pub fn dispatcher_clap_attr(attr: TokenStream, item: TokenStream) -> TokenStream
#[allow(non_snake_case)]
#[::mingling::macros::help]
fn #help_fn_name(_prev: #struct_name) {
- let mut buf = Vec::new();
<#struct_name as ::clap::CommandFactory>::command()
- .write_help(&mut buf)
+ .write_help(r)
.unwrap();
- let help_txt = String::from_utf8(buf).unwrap();
- r_println!("{}", help_txt)
}
})
} else {