Update for new versions of supports-* crates

This commit is contained in:
George Pollard 2023-03-13 21:16:50 +00:00 committed by GitHub
parent 3f30d76505
commit 4c3dcd7c22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ once_cell = "1.8.0"
unicode-width = "0.1.9"
owo-colors = { version = "3.0.0", optional = true }
is-terminal = { version = "0.4.1", optional = true }
is-terminal = { version = "0.4.0", optional = true }
textwrap = { version = "0.15.0", optional = true }
supports-hyperlinks = { git = "https://github.com/Porges/supports-hyperlinks", optional = true }
supports-color = { git = "https://github.com/zkat/supports-color", optional = true }

View File

@ -191,7 +191,9 @@ impl MietteHandlerOpts {
let characters = match self.unicode {
Some(true) => ThemeCharacters::unicode(),
Some(false) => ThemeCharacters::ascii(),
None if supports_unicode::on(&std::io::stderr()) => ThemeCharacters::unicode(),
None if supports_unicode::on(supports_unicode::Stream::Stderr) => {
ThemeCharacters::unicode()
}
None => ThemeCharacters::ascii(),
};
let styles = if self.color == Some(false) {
@ -255,7 +257,7 @@ impl MietteHandlerOpts {
if let Some(linkify) = self.linkify {
linkify
} else {
supports_hyperlinks::on(&std::io::stderr())
supports_hyperlinks::on(supports_hyperlinks::Stream::Stderr)
}
}