Skip to content

Commit aba5e44

Browse files
committed
Configure snippets renderer to match rustc/Cargo style
1 parent 0731d17 commit aba5e44

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/cargo/core/shell.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,11 @@ impl Shell {
415415
writeln!(
416416
self.err(),
417417
"{}",
418-
Renderer::styled().term_width(term_width).render(message)
418+
Renderer::styled()
419+
.note(NOTE)
420+
.help(HELP)
421+
.term_width(term_width)
422+
.render(message)
419423
)
420424
}
421425
}

src/cargo/util/style.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub const PLACEHOLDER: Style = AnsiColor::Cyan.on_default();
88
pub const ERROR: Style = AnsiColor::Red.on_default().effects(Effects::BOLD);
99
pub const WARN: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD);
1010
pub const NOTE: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD);
11+
pub const HELP: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD);
1112
pub const GOOD: Style = AnsiColor::Green.on_default().effects(Effects::BOLD);
1213
pub const VALID: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD);
1314
pub const INVALID: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD);

tests/testsuite/lints/error/stderr.term.svg

Lines changed: 2 additions & 2 deletions
Loading

tests/testsuite/lints/inherited/stderr.term.svg

Lines changed: 4 additions & 5 deletions
Loading

tests/testsuite/lints/warning/stderr.term.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)