diff --git a/Cargo.lock b/Cargo.lock index 7c7649f62b3..c401a80c802 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "annotate-snippets" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a851f39ec7e23bf1c30faf3844a496fee4db701f5f840f68d1f78f00e697892" +checksum = "4b0f1e2f8ec4bff67c7e1867001ec452595daf315cce10c393b7d4274024f878" dependencies = [ "anstyle", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 7fd04749b03..4684ef0ec55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" [workspace.dependencies] -annotate-snippets = { version = "0.12.1", features = ["simd"] } +annotate-snippets = { version = "0.12.3", features = ["simd"] } anstream = "0.6.20" anstyle = "1.0.11" anyhow = "1.0.98" diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index f549e4b1325..aba77bd96ff 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -163,7 +163,7 @@ fn print_list(gctx: &GlobalContext, is_verbose: bool) { ]); drop_println!( gctx, - color_print::cstr!("Installed Commands:") + color_print::cstr!("Installed Commands:") ); for (name, command) in list_commands(gctx) { let known_external_desc = known_external_command_descriptions.get(name.as_str()); @@ -557,11 +557,11 @@ pub fn cli(gctx: &GlobalContext) -> Command { let usage = if is_rustup() { color_print::cstr!( - "cargo [+toolchain] [OPTIONS] [COMMAND]\n cargo [+toolchain] [OPTIONS] -Zscript <> [ARGS]..." + "cargo [+toolchain] [OPTIONS] [COMMAND]\n cargo [+toolchain] [OPTIONS] -Zscript <> [ARGS]..." ) } else { color_print::cstr!( - "cargo [OPTIONS] [COMMAND]\n cargo [OPTIONS] -Zscript <> [ARGS]..." + "cargo [OPTIONS] [COMMAND]\n cargo [OPTIONS] -Zscript <> [ARGS]..." ) }; @@ -592,31 +592,31 @@ pub fn cli(gctx: &GlobalContext) -> Command { "\ Rust's package manager -Usage: {usage} +Usage: {usage} -Options: +Options: {options} -Commands: - build, b Compile the current package - check, c Analyze the current package and report errors, but don't build object files - clean Remove the target directory - doc, d Build this package's and its dependencies' documentation - new Create a new cargo package - init Create a new cargo package in an existing directory - add Add dependencies to a manifest file - remove Remove dependencies from a manifest file - run, r Run a binary or example of the local package - test, t Run the tests - bench Run the benchmarks - update Update dependencies listed in Cargo.lock - search Search registry for crates - publish Package and upload this package to the registry - install Install a Rust binary - uninstall Uninstall a Rust binary - ... See all commands with --list - -See 'cargo help <>' for more information on a specific command.\n", +Commands: + build, b Compile the current package + check, c Analyze the current package and report errors, but don't build object files + clean Remove the target directory + doc, d Build this package's and its dependencies' documentation + new Create a new cargo package + init Create a new cargo package in an existing directory + add Add dependencies to a manifest file + remove Remove dependencies from a manifest file + run, r Run a binary or example of the local package + test, t Run the tests + bench Run the benchmarks + update Update dependencies listed in Cargo.lock + search Search registry for crates + publish Package and upload this package to the registry + install Install a Rust binary + uninstall Uninstall a Rust binary + ... See all commands with --list + +See 'cargo help <>' for more information on a specific command.\n", )) .arg(flag("version", "Print version info and exit").short('V')) .arg(flag("list", "List installed commands")) diff --git a/src/bin/cargo/commands/add.rs b/src/bin/cargo/commands/add.rs index 166e56d135b..8cabda1acd3 100644 --- a/src/bin/cargo/commands/add.rs +++ b/src/bin/cargo/commands/add.rs @@ -18,11 +18,11 @@ pub fn cli() -> Command { .about("Add dependencies to a Cargo.toml manifest file") .override_usage( color_print::cstr!("\ - cargo add [OPTIONS] <>[@<>] ... - cargo add [OPTIONS] --path <> ... - cargo add [OPTIONS] --git <> ..." + cargo add [OPTIONS] <>[@<>] ... + cargo add [OPTIONS] --path <> ... + cargo add [OPTIONS] --git <> ..." )) - .after_help(color_print::cstr!("Run `cargo help add` for more detailed information.\n")) + .after_help(color_print::cstr!("Run `cargo help add` for more detailed information.\n")) .group(clap::ArgGroup::new("selected").multiple(true).required(true)) .args([ clap::Arg::new("crates") diff --git a/src/bin/cargo/commands/bench.rs b/src/bin/cargo/commands/bench.rs index b4b4b664c37..f78e3b70ee2 100644 --- a/src/bin/cargo/commands/bench.rs +++ b/src/bin/cargo/commands/bench.rs @@ -53,7 +53,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help bench` for more detailed information.\n" + "Run `cargo help bench` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/build.rs b/src/bin/cargo/commands/build.rs index 51b019d4382..3d8ced9630e 100644 --- a/src/bin/cargo/commands/build.rs +++ b/src/bin/cargo/commands/build.rs @@ -43,7 +43,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help build` for more detailed information.\n" + "Run `cargo help build` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/check.rs b/src/bin/cargo/commands/check.rs index 957195498ab..9ba340b4a79 100644 --- a/src/bin/cargo/commands/check.rs +++ b/src/bin/cargo/commands/check.rs @@ -40,7 +40,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help check` for more detailed information.\n" + "Run `cargo help check` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/clean.rs b/src/bin/cargo/commands/clean.rs index c1792388e44..e14ebd379d1 100644 --- a/src/bin/cargo/commands/clean.rs +++ b/src/bin/cargo/commands/clean.rs @@ -122,7 +122,7 @@ pub fn cli() -> Command { ), ) .after_help(color_print::cstr!( - "Run `cargo help clean` for more detailed information.\n" + "Run `cargo help clean` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index 20f39618cf3..3f918a06b29 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -42,7 +42,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help doc` for more detailed information.\n" + "Run `cargo help doc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/fetch.rs b/src/bin/cargo/commands/fetch.rs index 2fdba80baf8..5486d0c43b2 100644 --- a/src/bin/cargo/commands/fetch.rs +++ b/src/bin/cargo/commands/fetch.rs @@ -11,7 +11,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help fetch` for more detailed information.\n" + "Run `cargo help fetch` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/fix.rs b/src/bin/cargo/commands/fix.rs index f638599c4e6..d9893a27da4 100644 --- a/src/bin/cargo/commands/fix.rs +++ b/src/bin/cargo/commands/fix.rs @@ -57,7 +57,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help fix` for more detailed information.\n" + "Run `cargo help fix` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/generate_lockfile.rs b/src/bin/cargo/commands/generate_lockfile.rs index 1f0be40fbf1..878dfe9e964 100644 --- a/src/bin/cargo/commands/generate_lockfile.rs +++ b/src/bin/cargo/commands/generate_lockfile.rs @@ -10,7 +10,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version_with_help("Ignore `rust-version` specification in packages") .after_help(color_print::cstr!( - "Run `cargo help generate-lockfile` for more detailed information.\n" + "Run `cargo help generate-lockfile` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/info.rs b/src/bin/cargo/commands/info.rs index 31b68f3e89b..a06e4ce08ca 100644 --- a/src/bin/cargo/commands/info.rs +++ b/src/bin/cargo/commands/info.rs @@ -17,7 +17,7 @@ pub fn cli() -> Command { .arg_registry("Registry to search packages in") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help info` for more detailed information.\n" + "Run `cargo help info` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/init.rs b/src/bin/cargo/commands/init.rs index 614a200799d..f048966fe05 100644 --- a/src/bin/cargo/commands/init.rs +++ b/src/bin/cargo/commands/init.rs @@ -15,7 +15,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help init` for more detailed information.\n" + "Run `cargo help init` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs index 30ec8884512..7668b376c64 100644 --- a/src/bin/cargo/commands/install.rs +++ b/src/bin/cargo/commands/install.rs @@ -105,7 +105,7 @@ pub fn cli() -> Command { .arg_timings() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help install` for more detailed information.\n" + "Run `cargo help install` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/locate_project.rs b/src/bin/cargo/commands/locate_project.rs index 92729657ff1..49d6e6ca256 100644 --- a/src/bin/cargo/commands/locate_project.rs +++ b/src/bin/cargo/commands/locate_project.rs @@ -16,7 +16,7 @@ pub fn cli() -> Command { .arg_silent_suggestion() .arg_manifest_path() .after_help(color_print::cstr!( - "Run `cargo help locate-project` for more detailed information.\n" + "Run `cargo help locate-project` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/login.rs b/src/bin/cargo/commands/login.rs index 7fe86b9b0c6..62a3b1dc1f5 100644 --- a/src/bin/cargo/commands/login.rs +++ b/src/bin/cargo/commands/login.rs @@ -21,7 +21,7 @@ pub fn cli() -> Command { ) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help login` for more detailed information.\n" + "Run `cargo help login` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/logout.rs b/src/bin/cargo/commands/logout.rs index 57df53ad737..3660b3102d5 100644 --- a/src/bin/cargo/commands/logout.rs +++ b/src/bin/cargo/commands/logout.rs @@ -9,7 +9,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help logout` for more detailed information.\n" + "Run `cargo help logout` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/metadata.rs b/src/bin/cargo/commands/metadata.rs index 0b98d50a114..d082af33abd 100644 --- a/src/bin/cargo/commands/metadata.rs +++ b/src/bin/cargo/commands/metadata.rs @@ -29,7 +29,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help metadata` for more detailed information.\n" + "Run `cargo help metadata` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/new.rs b/src/bin/cargo/commands/new.rs index 35a85e0499b..3af05ced370 100644 --- a/src/bin/cargo/commands/new.rs +++ b/src/bin/cargo/commands/new.rs @@ -15,7 +15,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help new` for more detailed information.\n" + "Run `cargo help new` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/owner.rs b/src/bin/cargo/commands/owner.rs index 659408758df..9816af2b215 100644 --- a/src/bin/cargo/commands/owner.rs +++ b/src/bin/cargo/commands/owner.rs @@ -29,7 +29,7 @@ pub fn cli() -> Command { .arg(opt("token", "API token to use when authenticating").value_name("TOKEN")) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help owner` for more detailed information.\n" + "Run `cargo help owner` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/package.rs b/src/bin/cargo/commands/package.rs index ae556eda234..aa16989b3d3 100644 --- a/src/bin/cargo/commands/package.rs +++ b/src/bin/cargo/commands/package.rs @@ -52,7 +52,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help package` for more detailed information.\n" + "Run `cargo help package` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/pkgid.rs b/src/bin/cargo/commands/pkgid.rs index aa98dc5c335..a007653fe00 100644 --- a/src/bin/cargo/commands/pkgid.rs +++ b/src/bin/cargo/commands/pkgid.rs @@ -12,7 +12,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help pkgid` for more detailed information.\n" + "Run `cargo help pkgid` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/publish.rs b/src/bin/cargo/commands/publish.rs index 57eff8d0324..572312eefae 100644 --- a/src/bin/cargo/commands/publish.rs +++ b/src/bin/cargo/commands/publish.rs @@ -30,7 +30,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help publish` for more detailed information.\n" + "Run `cargo help publish` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/read_manifest.rs b/src/bin/cargo/commands/read_manifest.rs index c014c99f5f7..f725e4befa8 100644 --- a/src/bin/cargo/commands/read_manifest.rs +++ b/src/bin/cargo/commands/read_manifest.rs @@ -9,7 +9,7 @@ pub fn cli() -> Command { "\ DEPRECATED: Print a JSON representation of a Cargo.toml manifest. -Use `cargo metadata --no-deps` instead.\ +Use `cargo metadata --no-deps` instead.\ " )) .arg_silent_suggestion() diff --git a/src/bin/cargo/commands/remove.rs b/src/bin/cargo/commands/remove.rs index f5e2237c6d9..60979cae26f 100644 --- a/src/bin/cargo/commands/remove.rs +++ b/src/bin/cargo/commands/remove.rs @@ -56,7 +56,7 @@ pub fn cli() -> clap::Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help remove` for more detailed information.\n" + "Run `cargo help remove` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/report.rs b/src/bin/cargo/commands/report.rs index 75918699b1e..6283d490203 100644 --- a/src/bin/cargo/commands/report.rs +++ b/src/bin/cargo/commands/report.rs @@ -6,7 +6,7 @@ pub fn cli() -> Command { subcommand("report") .about("Generate and display various kinds of reports") .after_help(color_print::cstr!( - "Run `cargo help report` for more detailed information.\n" + "Run `cargo help report` for more detailed information.\n" )) .subcommand_required(true) .arg_required_else_help(true) diff --git a/src/bin/cargo/commands/run.rs b/src/bin/cargo/commands/run.rs index 2f1ce6a26a4..20b46052b3f 100644 --- a/src/bin/cargo/commands/run.rs +++ b/src/bin/cargo/commands/run.rs @@ -43,7 +43,7 @@ pub fn cli() -> Command { .arg_unit_graph() .arg_timings() .after_help(color_print::cstr!( - "Run `cargo help run` for more detailed information.\n" + "Run `cargo help run` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/rustc.rs b/src/bin/cargo/commands/rustc.rs index cee871db025..37be9e08f56 100644 --- a/src/bin/cargo/commands/rustc.rs +++ b/src/bin/cargo/commands/rustc.rs @@ -54,7 +54,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help rustc` for more detailed information.\n" + "Run `cargo help rustc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/rustdoc.rs b/src/bin/cargo/commands/rustdoc.rs index 5a226f421b1..e931a62b024 100644 --- a/src/bin/cargo/commands/rustdoc.rs +++ b/src/bin/cargo/commands/rustdoc.rs @@ -48,7 +48,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help rustdoc` for more detailed information.\n" + "Run `cargo help rustdoc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/search.rs b/src/bin/cargo/commands/search.rs index f51f59d2dd9..6d7894b4e1f 100644 --- a/src/bin/cargo/commands/search.rs +++ b/src/bin/cargo/commands/search.rs @@ -19,7 +19,7 @@ pub fn cli() -> Command { .arg_registry("Registry to search packages in") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help search` for more detailed information.\n" + "Run `cargo help search` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/test.rs b/src/bin/cargo/commands/test.rs index bca0e8b6889..3c9e83a803b 100644 --- a/src/bin/cargo/commands/test.rs +++ b/src/bin/cargo/commands/test.rs @@ -63,8 +63,8 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help test` for more detailed information.\n\ - Run `cargo test -- --help` for test binary options.\n", + "Run `cargo help test` for more detailed information.\n\ + Run `cargo test -- --help` for test binary options.\n", )) } diff --git a/src/bin/cargo/commands/tree.rs b/src/bin/cargo/commands/tree.rs index 274a3f9cf45..e2cd954b6ad 100644 --- a/src/bin/cargo/commands/tree.rs +++ b/src/bin/cargo/commands/tree.rs @@ -97,7 +97,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help tree` for more detailed information.\n" + "Run `cargo help tree` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/uninstall.rs b/src/bin/cargo/commands/uninstall.rs index d50996d9af6..2f764d4549e 100644 --- a/src/bin/cargo/commands/uninstall.rs +++ b/src/bin/cargo/commands/uninstall.rs @@ -21,7 +21,7 @@ pub fn cli() -> Command { .help_heading(heading::TARGET_SELECTION), ) .after_help(color_print::cstr!( - "Run `cargo help uninstall` for more detailed information.\n" + "Run `cargo help uninstall` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/update.rs b/src/bin/cargo/commands/update.rs index 3b89d037d40..15700d0b361 100644 --- a/src/bin/cargo/commands/update.rs +++ b/src/bin/cargo/commands/update.rs @@ -55,7 +55,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version_with_help("Ignore `rust-version` specification in packages") .after_help(color_print::cstr!( - "Run `cargo help update` for more detailed information.\n" + "Run `cargo help update` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/vendor.rs b/src/bin/cargo/commands/vendor.rs index 63db209cca4..95175b483b5 100644 --- a/src/bin/cargo/commands/vendor.rs +++ b/src/bin/cargo/commands/vendor.rs @@ -39,7 +39,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help vendor` for more detailed information.\n" + "Run `cargo help vendor` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/version.rs b/src/bin/cargo/commands/version.rs index 78d3c658fec..eb30f98428f 100644 --- a/src/bin/cargo/commands/version.rs +++ b/src/bin/cargo/commands/version.rs @@ -6,7 +6,7 @@ pub fn cli() -> Command { .about("Show version information") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help version` for more detailed information.\n" + "Run `cargo help version` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/yank.rs b/src/bin/cargo/commands/yank.rs index b2bc147f0c9..c4c5c6fa00f 100644 --- a/src/bin/cargo/commands/yank.rs +++ b/src/bin/cargo/commands/yank.rs @@ -22,7 +22,7 @@ pub fn cli() -> Command { .arg(opt("token", "API token to use when authenticating").value_name("TOKEN")) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help yank` for more detailed information.\n" + "Run `cargo help yank` for more detailed information.\n" )) } diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 48c3f68dcee..e62d3b280ce 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -457,13 +457,11 @@ impl ShellOut { style: &Style, justified: bool, ) -> CargoResult<()> { - let bold = anstyle::Style::new() | anstyle::Effects::BOLD; - let mut buffer = Vec::new(); if justified { write!(&mut buffer, "{style}{status:>12}{style:#}")?; } else { - write!(&mut buffer, "{style}{status}{style:#}{bold}:{bold:#}")?; + write!(&mut buffer, "{style}{status}{style:#}:")?; } match message { Some(message) => writeln!(buffer, " {message}")?, diff --git a/src/cargo/ops/registry/info/view.rs b/src/cargo/ops/registry/info/view.rs index 2ac6b67d889..ab825acda88 100644 --- a/src/cargo/ops/registry/info/view.rs +++ b/src/cargo/ops/registry/info/view.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::io::Write; use crate::core::Shell; -use crate::util::style::{ERROR, HEADER, LITERAL, NOP, NOTE, WARN}; +use crate::util::style::{ERROR, HEADER, LITERAL, NOP, WARN}; use crate::{ CargoResult, GlobalContext, core::{ @@ -26,7 +26,7 @@ pub(super) fn pretty_view( let header = HEADER; let error = ERROR; let warn = WARN; - let note = NOTE; + let context = annotate_snippets::renderer::DEFAULT_CONTEXT_STYLE; let mut shell = gctx.shell(); let verbosity = shell.verbosity(); @@ -45,7 +45,7 @@ pub(super) fn pretty_view( } else { format!("#{}", metadata.keywords.join(" #")) }; - write!(shell.out(), " {note}{message}{note:#}")?; + write!(shell.out(), " {context}{message}{context:#}")?; } let stdout = shell.out(); @@ -68,7 +68,7 @@ pub(super) fn pretty_view( (Some(latest), false) if latest.as_summary().version() != package_id.version() => { write!( stdout, - " {warn}(latest {} {warn:#}{note}from {}{note:#}{warn}){warn:#}", + " {warn}(latest {} {warn:#}{context}from {}{context:#}{warn}){warn:#}", latest.as_summary().version(), pretty_source(summary.source_id(), gctx) )?; @@ -83,7 +83,7 @@ pub(super) fn pretty_view( (_, false) => { write!( stdout, - " {note}(from {}){note:#}", + " {context}(from {}){context:#}", pretty_source(summary.source_id(), gctx) )?; } diff --git a/src/cargo/ops/tree/mod.rs b/src/cargo/ops/tree/mod.rs index 99a82a2b791..347ec56153e 100644 --- a/src/cargo/ops/tree/mod.rs +++ b/src/cargo/ops/tree/mod.rs @@ -406,12 +406,12 @@ fn print_dependencies<'a>( let name = match kind { EdgeKind::Dep(DepKind::Normal) => None, - EdgeKind::Dep(DepKind::Build) => { - Some(color_print::cstr!("[build-dependencies]")) - } - EdgeKind::Dep(DepKind::Development) => { - Some(color_print::cstr!("[dev-dependencies]")) - } + EdgeKind::Dep(DepKind::Build) => Some(color_print::cstr!( + "[build-dependencies]" + )), + EdgeKind::Dep(DepKind::Development) => Some(color_print::cstr!( + "[dev-dependencies]" + )), EdgeKind::Feature => None, }; diff --git a/src/cargo/util/style.rs b/src/cargo/util/style.rs index 618a10876bf..824f42b59b4 100644 --- a/src/cargo/util/style.rs +++ b/src/cargo/util/style.rs @@ -1,13 +1,13 @@ use anstyle::*; pub const NOP: Style = Style::new(); -pub const HEADER: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const USAGE: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const LITERAL: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); +pub const HEADER: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const USAGE: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const LITERAL: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); pub const PLACEHOLDER: Style = AnsiColor::Cyan.on_default(); -pub const ERROR: Style = AnsiColor::Red.on_default().effects(Effects::BOLD); -pub const WARN: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD); -pub const NOTE: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); -pub const GOOD: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const VALID: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); -pub const INVALID: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD); +pub const ERROR: Style = annotate_snippets::renderer::DEFAULT_ERROR_STYLE; +pub const WARN: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; +pub const NOTE: Style = annotate_snippets::renderer::DEFAULT_NOTE_STYLE; +pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); +pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; diff --git a/tests/testsuite/cargo/help/stdout.term.svg b/tests/testsuite/cargo/help/stdout.term.svg index 65f66ac859b..541e3465a86 100644 --- a/tests/testsuite/cargo/help/stdout.term.svg +++ b/tests/testsuite/cargo/help/stdout.term.svg @@ -2,8 +2,9 @@