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 8b9bab8e83
commit 75d2ea96d9
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -109,7 +109,7 @@ extern crate state;
extern crate time;
extern crate memchr;
extern crate base64;
extern crate isatty;
extern crate atty;
#[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;
}
if !::isatty::stdout_isatty()
if !::atty::is(::atty::Stream::Stdout)
|| (cfg!(windows) && !Paint::enable_windows_ascii())
|| env::var_os(COLORS_ENV).map(|v| v == "0" || v == "off").unwrap_or(false)
{