Skip to content

Commit 57689f7

Browse files
committed
Rename Supress variant
1 parent 5021928 commit 57689f7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/bootstrap/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum OutputMode {
1818
/// Print the output (by inheriting stdout/stderr).
1919
PrintOutput,
2020
/// Suppress the output if the command succeeds, otherwise print the output.
21-
Suppress,
21+
SuppressOnSuccess,
2222
}
2323

2424
/// Wrapper around `std::process::Command`.
@@ -43,6 +43,6 @@ impl<'a> BootstrapCommand<'a> {
4343

4444
impl<'a> From<&'a mut Command> for BootstrapCommand<'a> {
4545
fn from(command: &'a mut Command) -> Self {
46-
Self { command, failure_behavior: None, output_mode: OutputMode::Suppress }
46+
Self { command, failure_behavior: None, output_mode: OutputMode::SuppressOnSuccess }
4747
}
4848
}

src/bootstrap/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,14 +984,18 @@ impl Build {
984984

985985
/// Runs a command, printing out nice contextual information if it fails.
986986
fn run_quiet(&self, cmd: &mut Command) {
987-
self.run_cmd(BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::Suppress));
987+
self.run_cmd(
988+
BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::SuppressOnSuccess),
989+
);
988990
}
989991

990992
/// Runs a command, printing out nice contextual information if it fails.
991993
/// Exits if the command failed to execute at all, otherwise returns its
992994
/// `status.success()`.
993995
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
994-
self.run_cmd(BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::Suppress))
996+
self.run_cmd(
997+
BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::SuppressOnSuccess),
998+
)
995999
}
9961000

9971001
/// A centralized function for running commands that do not return output.
@@ -1012,7 +1016,7 @@ impl Build {
10121016
}),
10131017
matches!(mode, OutputMode::PrintAll),
10141018
),
1015-
OutputMode::Suppress => (command.command.output(), true),
1019+
OutputMode::SuppressOnSuccess => (command.command.output(), true),
10161020
};
10171021

10181022
let output = match output {

0 commit comments

Comments
 (0)