chore: use if instead of matching

Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
This commit is contained in:
Sergey Dubovyk 2020-08-25 11:07:19 +03:00 committed by GitHub
parent 530b179776
commit d525be42c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -568,9 +568,10 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
spec_vals.push(format!("[possible values: {}]", a.possible_vals.join(", ")));
}
let prefix = match !spec_vals.is_empty() && !a.get_about().unwrap_or("").is_empty() {
true => " ",
false => "",
let prefix = if !spec_vals.is_empty() && !a.get_about().unwrap_or("").is_empty() {
" "
} else {
""
};
prefix.to_string() + &spec_vals.join(" ")
}