Skip to content

Commit 2a02dbb

Browse files
committed
Replace atty with is-terminal
1 parent e4156bd commit 2a02dbb

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

Cargo.lock

Lines changed: 3 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ toml = "0.7"
3535
winreg = "0.11"
3636

3737
[target.'cfg(unix)'.dependencies]
38-
atty = "0.2"
38+
is-terminal = "0.4.6"
3939

4040
[dev-dependencies]
4141
lazy_static = "1"

src/platform.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use std::fs;
99
use std::path::PathBuf;
1010
use std::time::{SystemTime, UNIX_EPOCH};
1111

12+
use is_terminal::IsTerminal as _;
13+
1214
// Last-modified time of a directory, in milliseconds since the UNIX epoch.
1315
pub fn dir_last_modified(dir: &fs::DirEntry) -> u128 {
1416
dir.metadata()
@@ -62,7 +64,7 @@ mod inner {
6264
This depends on whether `rust-script`'s STDERR is connected to a TTY or not.
6365
*/
6466
pub fn force_cargo_color() -> bool {
65-
atty::is(atty::Stream::Stderr)
67+
std::io::stderr().is_terminal()
6668
}
6769
}
6870

0 commit comments

Comments
 (0)