mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
fmt: apply cargo fmt suggestions
This commit is contained in:
1 parent
bece2eacf0
commit
c2f99e5f94
2 files changed
+9
-15
No files matched your search
@@ -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,
|
||||||
|
|||||||
@@ -440,4 +440,4 @@ fn windows_quote_before_quote_args() {
|
|||||||
.arg("dir \"..\\src\\\" \"..\\tests\\\"")
|
.arg("dir \"..\\src\\\" \"..\\tests\\\"")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user