summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Witzel <pedro.witzel@gmail.com>2023-08-28 23:11:40 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2023-10-05 09:25:07 +0200
commitc2f99e5f94bea7fc64d8074cc2f0d4ee01bbb5c7 (patch)
treeba23beb87499aa62dd9eae387d495125d2c41d2f
parentbece2eacf0939f376c9f046ee0bacc794e2a5ffe (diff)
fmt: apply cargo fmt suggestions
-rw-r--r--src/benchmark/executor.rs24
-rw-r--r--tests/integration_tests.rs2
2 files changed, 10 insertions, 16 deletions
diff --git a/src/benchmark/executor.rs b/src/benchmark/executor.rs
index 9707b4e..0ab5bbe 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 22ef5a8..5a6a67e 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
+}