mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-01 11:26:37 +00:00
clippy: use matches!
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
a81b2672d8
commit
b1c2250000
@ -87,12 +87,8 @@ fn get_simple_completion(
|
||||
if !arg_param.is_empty() {
|
||||
let prop_name = arg_param[0];
|
||||
if let Some((optional, schema)) = cli_cmd.info.parameters.lookup(prop_name) {
|
||||
let is_array_param = if let Schema::Array(_) = schema {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
let is_array_param = matches!(schema, Schema::Array(_));
|
||||
|
||||
if (optional || is_array_param) && args[0].starts_with('-') {
|
||||
// argument parameter is optional (or array) , and arg
|
||||
// looks like an option, so assume its empty and
|
||||
|
@ -391,11 +391,7 @@ fn format_table<W: Write>(
|
||||
Some(tup) => tup,
|
||||
None => bail!("property {} does not exist in schema.", sortkey),
|
||||
};
|
||||
let numeric_sort = match sort_prop_schema {
|
||||
Schema::Integer(_) => true,
|
||||
Schema::Number(_) => true,
|
||||
_ => false,
|
||||
};
|
||||
let numeric_sort = matches!(sort_prop_schema, Schema::Integer(_) | Schema::Number(_));
|
||||
sortinfo.push((sortkey, sort_order, numeric_sort));
|
||||
}
|
||||
|
||||
@ -454,12 +450,7 @@ fn format_table<W: Write>(
|
||||
None => bail!("property {} does not exist in schema.", name),
|
||||
};
|
||||
|
||||
let is_numeric = match prop_schema {
|
||||
Schema::Integer(_) => true,
|
||||
Schema::Number(_) => true,
|
||||
Schema::Boolean(_) => true,
|
||||
_ => false,
|
||||
};
|
||||
let is_numeric = matches!(prop_schema, Schema::Integer(_) | Schema::Number(_) | Schema::Boolean(_));
|
||||
|
||||
let (header, right_align, renderer) = options.lookup_column_info(name);
|
||||
|
||||
@ -658,12 +649,7 @@ fn format_object<W: Write>(
|
||||
None => bail!("property {} does not exist in schema.", name),
|
||||
};
|
||||
|
||||
let is_numeric = match prop_schema {
|
||||
Schema::Integer(_) => true,
|
||||
Schema::Number(_) => true,
|
||||
Schema::Boolean(_) => true,
|
||||
_ => false,
|
||||
};
|
||||
let is_numeric = matches!(prop_schema, Schema::Integer(_) | Schema::Number(_) | Schema::Boolean(_));
|
||||
|
||||
let (header, right_align, renderer) = options.lookup_column_info(name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user