From b210ad69eb12d3ea3c4dc9291f89f57726cb3a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 27 Nov 2020 11:43:55 +0100 Subject: [PATCH] run 'cargo fmt' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- proxmox/src/api/cli/command.rs | 13 +++++-------- proxmox/src/api/cli/mod.rs | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/proxmox/src/api/cli/command.rs b/proxmox/src/api/cli/command.rs index c165fec4..50f5979d 100644 --- a/proxmox/src/api/cli/command.rs +++ b/proxmox/src/api/cli/command.rs @@ -175,7 +175,6 @@ fn parse_nested_command<'a>( return Err(format_err!("{}", err_msg)); } - let command = args.remove(0); let (_, sub_cmd) = match map.find_command(&command) { @@ -265,15 +264,13 @@ pub(crate) fn help_command_def() -> CliCommand { CliCommand::new(&API_METHOD_COMMAND_HELP).arg_param(&["command"]) } -fn replace_aliases( - args: &mut Vec, - aliases: &[(Vec<&'static str>, Vec<&'static str>)], -) { +fn replace_aliases(args: &mut Vec, aliases: &[(Vec<&'static str>, Vec<&'static str>)]) { for (old, new) in aliases { - if args.len() < old.len() { continue; } + if args.len() < old.len() { + continue; + } if old[..] == args[..old.len()] { - let new_args: Vec = new.iter() - .map(|s| String::from(*s)).collect(); + let new_args: Vec = new.iter().map(|s| String::from(*s)).collect(); let rest = args.split_off(old.len()); args.truncate(0); args.extend(new_args); diff --git a/proxmox/src/api/cli/mod.rs b/proxmox/src/api/cli/mod.rs index 71ecd461..44912622 100644 --- a/proxmox/src/api/cli/mod.rs +++ b/proxmox/src/api/cli/mod.rs @@ -116,7 +116,7 @@ impl CliCommandMap { self } - pub fn alias(mut self, old: &'static[&'static str], new: &'static[&'static str]) -> Self { + pub fn alias(mut self, old: &'static [&'static str], new: &'static [&'static str]) -> Self { self.aliases.push((Vec::from(old), Vec::from(new))); self }