mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
refactor(complete): Remove unnecessary early return
There seems to be little reason to return early with an empty list when there are no subcommands, instead of going through the loop 0 times and then returning the empty list.
This commit is contained in:
parent
8d0ef124e0
commit
9c59c69bb0
1 changed files with 0 additions and 4 deletions
|
@ -39,10 +39,6 @@ pub fn subcommands(p: &Command) -> Vec<(String, String)> {
|
|||
|
||||
let mut subcmds = vec![];
|
||||
|
||||
if !p.has_subcommands() {
|
||||
return subcmds;
|
||||
}
|
||||
|
||||
for sc in p.get_subcommands() {
|
||||
let sc_bin_name = sc.get_bin_name().unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue