From: Wolfgang Bumiller Date: Mon, 22 Jan 2024 13:55:05 +0000 (+0100) Subject: schema: cli: simplify can_default check X-Git-Url: https://git.proxmox.com/?p=proxmox.git;a=commitdiff_plain;h=2fa645af2e2efa5da6da60a1ba8a9bd369bd9594 schema: cli: simplify can_default check Signed-off-by: Wolfgang Bumiller --- diff --git a/proxmox-router/src/cli/getopts.rs b/proxmox-router/src/cli/getopts.rs index 6ab82187..85796bed 100644 --- a/proxmox-router/src/cli/getopts.rs +++ b/proxmox-router/src/cli/getopts.rs @@ -76,10 +76,7 @@ pub(crate) fn parse_argument_list>( let mut can_default = false; if let Some((_opt, Schema::Boolean(boolean_schema))) = schema.lookup(&name) { want_bool = true; - match boolean_schema.default { - Some(false) | None => can_default = true, - Some(true) => (), - } + can_default = matches!(boolean_schema.default, Some(false) | None); } let mut next_is_argument = false;