Skip to content

Commit

Permalink
Update owo-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Oct 23, 2024
1 parent 4090bec commit 32f6d0b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
52 changes: 24 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 6 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand All @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))*
),
}?;
}};
Expand Down Expand Up @@ -451,19 +451,19 @@ fn get_verbosity(

pub trait Stream {
type TTY: IsTerminal;
const OWO: owo_colors::Stream;
const OWO: Option<owo_colors::Stream>;

#[must_use]
fn is_atty() -> bool;

fn owo(&self) -> owo_colors::Stream {
fn owo(&self) -> Option<owo_colors::Stream> {
Self::OWO
}
}

impl Stream for io::Stdin {
type TTY = io::Stdin;
const OWO: owo_colors::Stream = owo_colors::Stream::Stdin;
const OWO: Option<owo_colors::Stream> = None;

fn is_atty() -> bool {
io::stdin().is_terminal()
Expand All @@ -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<owo_colors::Stream> = Some(owo_colors::Stream::Stdout);

fn is_atty() -> bool {
io::stdout().is_terminal()
Expand All @@ -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<owo_colors::Stream> = Some(owo_colors::Stream::Stderr);

fn is_atty() -> bool {
io::stderr().is_terminal()
Expand Down

0 comments on commit 32f6d0b

Please sign in to comment.