mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
perf: Do not clone subcommands
This saves a whopping 8K. I suspect it allows two sorting functions to be merged.
This commit is contained in:
parent
c77fb2e11d
commit
7774a8ee8a
1 changed files with 1 additions and 1 deletions
|
@ -846,7 +846,7 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
|
|||
}
|
||||
sc_str.push_str(&subcommand.name);
|
||||
longest = longest.max(display_width(&sc_str));
|
||||
ord_v.push((subcommand.get_display_order(), sc_str, subcommand.clone()));
|
||||
ord_v.push((subcommand.get_display_order(), sc_str, subcommand));
|
||||
}
|
||||
ord_v.sort_by(|a, b| (a.0, &a.1).cmp(&(b.0, &b.1)));
|
||||
|
||||
|
|
Loading…
Reference in a new issue