Replace deprecated 'isatty' with 'atty'.

This commit is contained in:
Richard Petrie 2019-02-09 06:29:02 -05:00 committed by Sergio Benitez
parent f81bdd90fc
commit 2cb35e2544
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ time = "0.1"
memchr = "2" # TODO: Use pear instead. memchr = "2" # TODO: Use pear instead.
base64 = "0.10" base64 = "0.10"
pear = "0.1" pear = "0.1"
isatty = "0.1" atty = "0.2"
[build-dependencies] [build-dependencies]
yansi = "0.5" yansi = "0.5"

View File

@ -111,7 +111,7 @@ extern crate state;
extern crate time; extern crate time;
extern crate memchr; extern crate memchr;
extern crate base64; extern crate base64;
extern crate isatty; extern crate atty;
#[cfg(test)] #[macro_use] extern crate lazy_static; #[cfg(test)] #[macro_use] extern crate lazy_static;

View File

@ -150,7 +150,7 @@ crate fn try_init(level: LoggingLevel, verbose: bool) -> bool {
return false; return false;
} }
if !::isatty::stdout_isatty() if !::atty::is(::atty::Stream::Stdout)
|| (cfg!(windows) && !Paint::enable_windows_ascii()) || (cfg!(windows) && !Paint::enable_windows_ascii())
|| env::var_os(COLORS_ENV).map(|v| v == "0" || v == "off").unwrap_or(false) || env::var_os(COLORS_ENV).map(|v| v == "0" || v == "off").unwrap_or(false)
{ {