mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
perf: reduce memory allocation
This commit is contained in:
parent
26fe5dbe96
commit
a895ef3d4c
1 changed files with 4 additions and 3 deletions
|
@ -207,12 +207,13 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b
|
|||
completions.push_str(format!(" export extern {} [\n", name).as_str());
|
||||
}
|
||||
|
||||
let s: String = cmd
|
||||
for s in cmd
|
||||
.get_arguments()
|
||||
.map(|arg| Argument::new(arg, name).to_string())
|
||||
.collect();
|
||||
{
|
||||
completions.push_str(&s);
|
||||
}
|
||||
|
||||
completions.push_str(&s);
|
||||
completions.push_str(" ]\n\n");
|
||||
|
||||
if is_subcommand {
|
||||
|
|
Loading…
Reference in a new issue