From 03d48dd735b18593f9e361f2156efae7bb551236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 11 Oct 2023 19:00:35 +0200 Subject: [PATCH] Rename Supress variant --- src/bootstrap/src/lib.rs | 10 +++++++--- src/bootstrap/src/utils/exec.rs | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 27d5faa3289a..6f9a9beb3316 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -937,14 +937,18 @@ impl Build { /// Runs a command, printing out nice contextual information if it fails. fn run_quiet(&self, cmd: &mut Command) { - self.run_cmd(BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::Suppress)); + self.run_cmd( + BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::SuppressOnSuccess), + ); } /// Runs a command, printing out nice contextual information if it fails. /// Exits if the command failed to execute at all, otherwise returns its /// `status.success()`. fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool { - self.run_cmd(BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::Suppress)) + self.run_cmd( + BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::SuppressOnSuccess), + ) } /// A centralized function for running commands that do not return output. @@ -965,7 +969,7 @@ impl Build { }), matches!(mode, OutputMode::PrintAll), ), - OutputMode::Suppress => (command.command.output(), true), + OutputMode::SuppressOnSuccess => (command.command.output(), true), }; let output = match output { diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index a3520ad5f983..f244f5152beb 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -18,7 +18,7 @@ pub enum OutputMode { /// Print the output (by inheriting stdout/stderr). PrintOutput, /// Suppress the output if the command succeeds, otherwise print the output. - Suppress, + SuppressOnSuccess, } /// Wrapper around `std::process::Command`. @@ -43,6 +43,6 @@ impl<'a> BootstrapCommand<'a> { impl<'a> From<&'a mut Command> for BootstrapCommand<'a> { fn from(command: &'a mut Command) -> Self { - Self { command, failure_behavior: None, output_mode: OutputMode::Suppress } + Self { command, failure_behavior: None, output_mode: OutputMode::SuppressOnSuccess } } }