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:
Martin von Zweigbergk 2022-09-26 21:33:53 -07:00
parent 8d0ef124e0
commit 9c59c69bb0

View file

@ -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();