mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 17:00:18 +00:00
fmt: apply cargo fmt suggestions
This commit is contained in:
1 parent
bece2eacf0
commit
c2f99e5f94
1 file changed
+8
-14
@@ -1,3 +1,4 @@
|
|||||||
|
#[cfg(windows)]
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
use std::process::ExitStatus;
|
use std::process::ExitStatus;
|
||||||
|
|
||||||
@@ -136,21 +137,14 @@ impl<'a> Executor for ShellExecutor<'a> {
|
|||||||
) -> Result<(TimingResult, ExitStatus)> {
|
) -> Result<(TimingResult, ExitStatus)> {
|
||||||
let on_windows_cmd = cfg!(windows) && *self.shell == Shell::Default("cmd.exe");
|
let on_windows_cmd = cfg!(windows) && *self.shell == Shell::Default("cmd.exe");
|
||||||
let mut command_builder = self.shell.command();
|
let mut command_builder = self.shell.command();
|
||||||
command_builder
|
command_builder.arg(if on_windows_cmd { "/C" } else { "-c" });
|
||||||
.arg(
|
|
||||||
if on_windows_cmd {
|
|
||||||
"/C"
|
|
||||||
} else {
|
|
||||||
"-c"
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// Windows needs special treatment for its behavior on parsing cmd arguments
|
// Windows needs special treatment for its behavior on parsing cmd arguments
|
||||||
if on_windows_cmd {
|
if on_windows_cmd {
|
||||||
command_builder.raw_arg(command.get_command_line());
|
command_builder.raw_arg(command.get_command_line());
|
||||||
} else {
|
} else {
|
||||||
command_builder.arg(command.get_command_line());
|
command_builder.arg(command.get_command_line());
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut result = run_command_and_measure_common(
|
let mut result = run_command_and_measure_common(
|
||||||
command_builder,
|
command_builder,
|
||||||
|
|||||||
Reference in new issue
Block a user