Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0279b7d

Browse files
committed
Replace isatty crate with atty
The `isatty` crate has been deprecated and a replacement has been released for it called `atty`. It offers a nicer API and the code change to adapt is trivial. Signed-off-by: Otavio Salvador <[email protected]>
1 parent 1b2e727 commit 0279b7d

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

Cargo.lock

Lines changed: 1 addition & 13 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
@@ -32,7 +32,7 @@ cargo-fmt = []
3232
rustfmt-format-diff = []
3333

3434
[dependencies]
35-
isatty = "0.1"
35+
atty = "0.2"
3636
itertools = "0.7"
3737
toml = "0.4"
3838
serde = "1.0"

src/config/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use config::config_type::ConfigType;
1212
use config::lists::*;
1313
use config::{Config, FileName};
1414

15-
use isatty::stdout_isatty;
15+
use atty;
1616

1717
use std::collections::HashSet;
1818
use std::path::{Path, PathBuf};
@@ -297,7 +297,7 @@ impl Color {
297297
match self {
298298
Color::Always => true,
299299
Color::Never => false,
300-
Color::Auto => stdout_isatty(),
300+
Color::Auto => atty::is(atty::Stream::Stdout),
301301
}
302302
}
303303
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
#[macro_use]
1818
extern crate derive_new;
19+
extern crate atty;
1920
extern crate diff;
2021
extern crate failure;
21-
extern crate isatty;
2222
extern crate itertools;
2323
#[cfg(test)]
2424
#[macro_use]

0 commit comments

Comments
 (0)