]> git.proxmox.com Git - proxmox.git/commitdiff
schema: cli: simplify can_default check
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 22 Jan 2024 13:55:05 +0000 (14:55 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 Jan 2024 08:20:42 +0000 (09:20 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-router/src/cli/getopts.rs

index 6ab8218766e9236cbd4ebde1a8bff095ffa45bf2..85796bed70254161af531604b3f29a78712de5da 100644 (file)
@@ -76,10 +76,7 @@ pub(crate) fn parse_argument_list<T: AsRef<str>>(
                     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;