fmt: apply cargo fmt suggestions

This commit is contained in:
Pedro Witzel authored and David Peter committed 2023-10-05 09:25:07 +02:00
1 parent bece2eacf0
commit c2f99e5f94
2 files changed
+9 -15

No files matched your search

+8 -14
View File
@@ -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"
},
);
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());
}
// 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,
+1 -1
View File
@@ -440,4 +440,4 @@ fn windows_quote_before_quote_args() {
.arg("dir \"..\\src\\\" \"..\\tests\\\"")
.assert()
.success();
}
}