From 00923e2a4180c39ccc2d0ab51a7548fb7bfa5719 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 26 Apr 2026 01:05:02 +0800 Subject: Remove intermediate buffer in help output --- mingling_macros/src/dispatcher_clap.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'mingling_macros/src/dispatcher_clap.rs') 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 { -- cgit