From 1e5a8c9db6e981ae243aaa4cccf8fb572715cd74 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sun, 6 Feb 2022 09:52:39 -0300 Subject: [PATCH] fix(cli.rs): lint warning on `cross_command` fn --- tooling/cli.rs/src/info.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tooling/cli.rs/src/info.rs b/tooling/cli.rs/src/info.rs index 0eb746874..8ab348ec8 100644 --- a/tooling/cli.rs/src/info.rs +++ b/tooling/cli.rs/src/info.rs @@ -97,18 +97,12 @@ fn crate_latest_version(name: &str) -> Option { } } +#[allow(clippy::let_and_return)] fn cross_command(bin: &str) -> Command { - let mut cmd; #[cfg(target_os = "windows")] - { - cmd = Command::new("cmd"); - cmd.arg("/c").arg(bin); - } - + let cmd = Command::new("cmd").arg("/c").arg(bin); #[cfg(not(target_os = "windows"))] - { - cmd = Command::new(bin) - } + let cmd = Command::new(bin); cmd }