From 525703358bf52b74a01d9b0c04680d33621d60cd Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 15 Apr 2023 12:21:11 +0200 Subject: Rework command execution structure and make rayon optional (since it's not necessarily faster due to workspace wide lockfile contention) --- xtask/src/command.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'xtask/src/command.rs') diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 32ca9c8..359a7f9 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -108,6 +108,14 @@ pub enum CargoCommand<'a> { }, } +impl core::fmt::Display for CargoCommand<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let executable = self.executable(); + let args = self.args().join(" "); + write!(f, "\"{executable} {args}\"") + } +} + impl<'a> CargoCommand<'a> { fn command(&self) -> &str { match self { @@ -460,12 +468,7 @@ impl fmt::Display for BuildMode { } pub fn run_command(command: &CargoCommand, stderr_mode: OutputMode) -> anyhow::Result { - let command_display = command.executable(); - let args = command.args(); - - let full_command = format!("\"{command_display}\" {}", args.join(" ")); - - debug!("👟 {full_command}"); + debug!("👟 {command}"); let result = Command::new(command.executable()) .args(command.args()) @@ -479,7 +482,6 @@ pub fn run_command(command: &CargoCommand, stderr_mode: OutputMode) -> anyhow::R Ok(RunResult { exit_status, - full_command, stdout, stderr, }) -- cgit v1.2.3