Skip to content

Commit

Permalink
Replace isatty crate with atty
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
otavio committed Oct 8, 2018
1 parent 1b2e727 commit 0279b7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
14 changes: 1 addition & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cargo-fmt = []
rustfmt-format-diff = []

[dependencies]
isatty = "0.1"
atty = "0.2"
itertools = "0.7"
toml = "0.4"
serde = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/config/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use config::config_type::ConfigType;
use config::lists::*;
use config::{Config, FileName};

use isatty::stdout_isatty;
use atty;

use std::collections::HashSet;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -297,7 +297,7 @@ impl Color {
match self {
Color::Always => true,
Color::Never => false,
Color::Auto => stdout_isatty(),
Color::Auto => atty::is(atty::Stream::Stdout),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#[macro_use]
extern crate derive_new;
extern crate atty;
extern crate diff;
extern crate failure;
extern crate isatty;
extern crate itertools;
#[cfg(test)]
#[macro_use]
Expand Down

0 comments on commit 0279b7d

Please sign in to comment.