diff --git a/Cargo.lock b/Cargo.lock index 521da2755..2551881a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,17 +89,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.2.0" @@ -226,7 +215,7 @@ dependencies = [ "eyre", "indenter", "once_cell", - "owo-colors", + "owo-colors 3.5.0", "tracing-error", ] @@ -237,7 +226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" dependencies = [ "once_cell", - "owo-colors", + "owo-colors 3.5.0", "tracing-core", "tracing-error", ] @@ -277,7 +266,7 @@ dependencies = [ "libc", "nix", "once_cell", - "owo-colors", + "owo-colors 4.1.0", "regex", "rustc_version", "semver", @@ -426,15 +415,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.9" @@ -511,7 +491,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "windows-sys", ] @@ -626,8 +606,15 @@ name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" dependencies = [ - "supports-color", + "supports-color 2.1.0", + "supports-color 3.0.1", ] [[package]] @@ -840,11 +827,20 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "supports-color" -version = "1.3.1" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" dependencies = [ - "atty", "is_ci", ] diff --git a/Cargo.toml b/Cargo.toml index 81216c9e1..821bc7a6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ signal-hook = { version = "0.3.15" } directories = "4.0.1" walkdir = { version = "2.3.2", optional = true } tempfile = "3.3.0" -owo-colors = { version = "3.5.0", features = ["supports-colors"] } +owo-colors = { version = "4.1.0", features = ["supports-colors"] } semver = "1.0.16" is_ci = "1.1.1" diff --git a/deny.toml b/deny.toml index 756088cc5..90a32e881 100644 --- a/deny.toml +++ b/deny.toml @@ -9,8 +9,9 @@ targets = [ [advisories] version = 2 -# FIXME: remove this if/when clap changes to is-terminal, atty is -# patched, or we migrated to an MSRV of 1.66.0. +# FIXME: remove this when color-eyre does a release of +# https://github.com/eyre-rs/eyre/pull/167 +# or if atty is patched. ignore = [ "RUSTSEC-2021-0145", ] @@ -20,6 +21,9 @@ multiple-versions = "deny" deny = [] skip-tree = [ { name = "nix", version = "=0.26.4", depth = 2 }, + # FIXME: remove this when color-eyre does a release of + # https://github.com/eyre-rs/eyre/pull/167 + { name = "owo-colors" }, ] [sources] diff --git a/src/shell.rs b/src/shell.rs index 8c88430c6..9af0f3dfe 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -27,7 +27,7 @@ macro_rules! write_style { ColorChoice::Auto => write!( $stream, "{}", - $message $(.if_supports_color($stream.owo(), |text| text.$style()))* + $message $(.if_supports_color($stream.owo().unwrap(), |text| text.$style()))* ), }?; }}; @@ -451,19 +451,19 @@ fn get_verbosity( pub trait Stream { type TTY: IsTerminal; - const OWO: owo_colors::Stream; + const OWO: Option; #[must_use] fn is_atty() -> bool; - fn owo(&self) -> owo_colors::Stream { + fn owo(&self) -> Option { Self::OWO } } impl Stream for io::Stdin { type TTY = io::Stdin; - const OWO: owo_colors::Stream = owo_colors::Stream::Stdin; + const OWO: Option = None; fn is_atty() -> bool { io::stdin().is_terminal() @@ -472,7 +472,7 @@ impl Stream for io::Stdin { impl Stream for io::Stdout { type TTY = io::Stdout; - const OWO: owo_colors::Stream = owo_colors::Stream::Stdout; + const OWO: Option = Some(owo_colors::Stream::Stdout); fn is_atty() -> bool { io::stdout().is_terminal() @@ -481,7 +481,7 @@ impl Stream for io::Stdout { impl Stream for io::Stderr { type TTY = io::Stderr; - const OWO: owo_colors::Stream = owo_colors::Stream::Stderr; + const OWO: Option = Some(owo_colors::Stream::Stderr); fn is_atty() -> bool { io::stderr().is_terminal()