Skip to content

Commit 93519e5

Browse files
committed
refactor: Centralize CONTEXT style
This is similar to #16124 in making it easier for others to see what styles cargo uses and copy them.
1 parent 36bc1d1 commit 93519e5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cargo/ops/registry/info/view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashMap;
22
use std::io::Write;
33

44
use crate::core::Shell;
5-
use crate::util::style::{ERROR, HEADER, LITERAL, NOP, WARN};
5+
use crate::util::style::{CONTEXT, ERROR, HEADER, LITERAL, NOP, WARN};
66
use crate::{
77
CargoResult, GlobalContext,
88
core::{
@@ -26,7 +26,7 @@ pub(super) fn pretty_view(
2626
let header = HEADER;
2727
let error = ERROR;
2828
let warn = WARN;
29-
let context = annotate_snippets::renderer::DEFAULT_CONTEXT_STYLE;
29+
let context = CONTEXT;
3030

3131
let mut shell = gctx.shell();
3232
let verbosity = shell.verbosity();

src/cargo/util/style.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOL
1212
pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD);
1313
pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE;
1414
pub const TRANSIENT: Style = annotate_snippets::renderer::DEFAULT_HELP_STYLE;
15+
pub const CONTEXT: Style = annotate_snippets::renderer::DEFAULT_CONTEXT_STYLE;
1516

1617
pub const UPDATE_ADDED: Style = NOTE;
1718
pub const UPDATE_REMOVED: Style = ERROR;

0 commit comments

Comments
 (0)