diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/anstream/src | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/anstream/src')
-rw-r--r-- | vendor/anstream/src/auto.rs | 18 | ||||
-rw-r--r-- | vendor/anstream/src/lib.rs | 16 | ||||
-rw-r--r-- | vendor/anstream/src/raw.rs | 4 |
3 files changed, 21 insertions, 17 deletions
diff --git a/vendor/anstream/src/auto.rs b/vendor/anstream/src/auto.rs index c2317460d..b252c05cb 100644 --- a/vendor/anstream/src/auto.rs +++ b/vendor/anstream/src/auto.rs @@ -58,7 +58,7 @@ where #[cfg(feature = "auto")] { if raw.is_terminal() { - let _ = concolor_query::windows::enable_ansi_colors(); + let _ = anstyle_query::windows::enable_ansi_colors(); } } Self::always_ansi_(raw) @@ -76,8 +76,8 @@ where if cfg!(windows) { #[cfg(feature = "auto")] let use_wincon = raw.is_terminal() - && !concolor_query::windows::enable_ansi_colors().unwrap_or(true) - && !concolor_query::term_supports_ansi_color(); + && !anstyle_query::windows::enable_ansi_colors().unwrap_or(true) + && !anstyle_query::term_supports_ansi_color(); #[cfg(not(feature = "auto"))] let use_wincon = true; if use_wincon { @@ -137,19 +137,19 @@ where #[cfg(feature = "auto")] fn choice(raw: &dyn RawStream) -> ColorChoice { - let choice = concolor_override::get(); + let choice = ColorChoice::global(); match choice { ColorChoice::Auto => { - let clicolor = concolor_query::clicolor(); + let clicolor = anstyle_query::clicolor(); let clicolor_enabled = clicolor.unwrap_or(false); let clicolor_disabled = !clicolor.unwrap_or(true); if raw.is_terminal() - && !concolor_query::no_color() + && !anstyle_query::no_color() && !clicolor_disabled - && (concolor_query::term_supports_color() + && (anstyle_query::term_supports_color() || clicolor_enabled - || concolor_query::is_ci()) - || concolor_query::clicolor_force() + || anstyle_query::is_ci()) + || anstyle_query::clicolor_force() { ColorChoice::Always } else { diff --git a/vendor/anstream/src/lib.rs b/vendor/anstream/src/lib.rs index 1600e8e06..582fa5221 100644 --- a/vendor/anstream/src/lib.rs +++ b/vendor/anstream/src/lib.rs @@ -10,6 +10,12 @@ //! - Semver safe way of passing styled text between crates as ANSI escape codes offer more //! compatibility than most crate APIs. //! +//! Available styling crates: +//! - [anstyle](https://docs.rs/anstyle) for minimal runtime styling, designed to go in public APIs +//! (once it hits 1.0) +//! - [owo-colors](https://docs.rs/owo-colors) for feature-rich runtime styling +//! - [color-print](https://docs.rs/color-print) for feature-rich compile-time styling +//! //! # Example //! //! ``` @@ -68,12 +74,6 @@ pub fn stderr() -> AutoStream<std::io::Stderr> { AutoStream::auto(stderr) } -/// Selection for overriding color output with [`force_color`] -#[cfg(feature = "auto")] -pub use concolor_override::ColorChoice; - -/// Override the detected [`ColorChoice`] +/// Selection for overriding color output #[cfg(feature = "auto")] -pub fn force_color(choice: ColorChoice) { - concolor_override::set(choice); -} +pub use colorchoice::ColorChoice; diff --git a/vendor/anstream/src/raw.rs b/vendor/anstream/src/raw.rs index d81db28c1..ecf7c6850 100644 --- a/vendor/anstream/src/raw.rs +++ b/vendor/anstream/src/raw.rs @@ -25,6 +25,8 @@ impl RawStream for std::io::Stderr {} impl RawStream for std::io::StderrLock<'static> {} +impl RawStream for std::fs::File {} + impl RawStream for crate::Buffer {} mod private { @@ -38,5 +40,7 @@ mod private { impl Sealed for std::io::StderrLock<'static> {} + impl Sealed for std::fs::File {} + impl Sealed for crate::Buffer {} } |