refactor: use IsTerminal from std instead of is-terminal crate

This commit is contained in:
Weihang Lo 2023-06-01 20:45:50 +01:00
parent 809b720f05
commit 8cb220f5eb
No known key found for this signature in database
GPG key ID: D7DBF189825E82E7
5 changed files with 4 additions and 7 deletions

2
Cargo.lock generated
View file

@ -274,7 +274,6 @@ dependencies = [
"ignore",
"im-rc",
"indexmap",
"is-terminal",
"itertools",
"jobserver",
"lazy_static",
@ -2658,7 +2657,6 @@ version = "0.0.0"
dependencies = [
"cargo",
"cargo-util",
"is-terminal",
"lazy_static",
"proptest",
"varisat",

View file

@ -45,7 +45,6 @@ humantime = "2.0.0"
ignore = "0.4.7"
im-rc = "15.0.0"
indexmap = "1"
is-terminal = "0.4.4"
itertools = "0.10.0"
jobserver = "0.1.26"
lazy_static = "1.3.0"
@ -136,7 +135,6 @@ humantime.workspace = true
ignore.workspace = true
im-rc.workspace = true
indexmap.workspace = true
is-terminal.workspace = true
itertools.workspace = true
jobserver.workspace = true
lazy_static.workspace = true

View file

@ -7,7 +7,6 @@ publish = false
[dependencies]
cargo.workspace = true
cargo-util.workspace = true
is-terminal.workspace = true
lazy_static.workspace = true
proptest.workspace = true
varisat.workspace = true

View file

@ -1,3 +1,5 @@
use std::io::IsTerminal;
use cargo::core::dependency::DepKind;
use cargo::core::Dependency;
use cargo::util::Config;
@ -21,7 +23,7 @@ use proptest::prelude::*;
proptest! {
#![proptest_config(ProptestConfig {
max_shrink_iters:
if is_ci() || !is_terminal::IsTerminal::is_terminal(&std::io::stderr()){
if is_ci() || !std::io::stderr().is_terminal() {
// This attempts to make sure that CI will fail fast,
0
} else {

View file

@ -1,7 +1,7 @@
use std::fmt;
use std::io::prelude::*;
use std::io::IsTerminal;
use is_terminal::IsTerminal;
use termcolor::Color::{Cyan, Green, Red, Yellow};
use termcolor::{self, Color, ColorSpec, StandardStream, WriteColor};