Skip to content

Commit

Permalink
fmt: apply cargo fmt suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroWitzel authored and sharkdp committed Oct 5, 2023
1 parent bece2ea commit c2f99e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
24 changes: 9 additions & 15 deletions src/benchmark/executor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(windows)]
use std::os::windows::process::CommandExt;
use std::process::ExitStatus;

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,4 @@ fn windows_quote_before_quote_args() {
.arg("dir \"..\\src\\\" \"..\\tests\\\"")
.assert()
.success();
}
}

0 comments on commit c2f99e5

Please sign in to comment.