Skip to content

Commit 6f57dcb

Browse files
committed
fix(shell): Use a distinct style for transient status
### What does this PR try to resolve? PR rust-lang#15928 made `Checking` and `Building` the same style because the transient state is `note:` and rust-lang#15928 made `note:~ the same as our regular headers. This switches the transient state to `help:` until we can further explore color choices with rustc. ### Notes See also https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/colors.20removed.20in.201.2E91.20.28current.20beta.29.3F/near/541900531
1 parent 3a33bda commit 6f57dcb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/cargo/core/shell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ impl Shell {
168168
self.print(&status, Some(&message), &HEADER, true)
169169
}
170170

171-
pub fn status_header<T>(&mut self, status: T) -> CargoResult<()>
171+
pub fn transient_status<T>(&mut self, status: T) -> CargoResult<()>
172172
where
173173
T: fmt::Display,
174174
{
175-
self.print(&status, None, &NOTE, true)
175+
self.print(&status, None, &TRANSIENT, true)
176176
}
177177

178178
/// Shortcut to right-align a status message.

src/cargo/util/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl<'gctx> State<'gctx> {
428428
if self.gctx.shell().is_cleared() || self.last_line.as_ref() != Some(&line) {
429429
let mut shell = self.gctx.shell();
430430
shell.set_needs_clear(false);
431-
shell.status_header(&self.name)?;
431+
shell.transient_status(&self.name)?;
432432
if let Some(tb) = report {
433433
write!(shell.err(), "{line}{tb}\r")?;
434434
} else {

src/cargo/util/style.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ pub const NOTE: Style = annotate_snippets::renderer::DEFAULT_NOTE_STYLE;
1111
pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD);
1212
pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD);
1313
pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE;
14+
pub const TRANSIENT: Style = annotate_snippets::renderer::DEFAULT_HELP_STYLE;

0 commit comments

Comments
 (0)