From c2f99e5f94bea7fc64d8074cc2f0d4ee01bbb5c7 Mon Sep 17 00:00:00 2001 From: Pedro Witzel Date: Mon, 28 Aug 2023 23:11:40 +0200 Subject: [PATCH] fmt: apply cargo fmt suggestions --- src/benchmark/executor.rs | 24 +++++++++--------------- tests/integration_tests.rs | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/benchmark/executor.rs b/src/benchmark/executor.rs index 9707b4e44..0ab5bbeb8 100644 --- a/src/benchmark/executor.rs +++ b/src/benchmark/executor.rs @@ -1,3 +1,4 @@ +#[cfg(windows)] use std::os::windows::process::CommandExt; use std::process::ExitStatus; @@ -136,21 +137,14 @@ impl<'a> Executor for ShellExecutor<'a> { ) -> Result<(TimingResult, ExitStatus)> { let on_windows_cmd = cfg!(windows) && *self.shell == Shell::Default("cmd.exe"); let mut command_builder = self.shell.command(); - command_builder - .arg( - if on_windows_cmd { - "/C" - } else { - "-c" - }, - ); - - // Windows needs special treatment for its behavior on parsing cmd arguments - if on_windows_cmd { - command_builder.raw_arg(command.get_command_line()); - } else { - command_builder.arg(command.get_command_line()); - } + command_builder.arg(if on_windows_cmd { "/C" } else { "-c" }); + + // Windows needs special treatment for its behavior on parsing cmd arguments + if on_windows_cmd { + command_builder.raw_arg(command.get_command_line()); + } else { + command_builder.arg(command.get_command_line()); + } let mut result = run_command_and_measure_common( command_builder, diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 22ef5a8c0..5a6a67e97 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -440,4 +440,4 @@ fn windows_quote_before_quote_args() { .arg("dir \"..\\src\\\" \"..\\tests\\\"") .assert() .success(); -} \ No newline at end of file +}