From 8cb220f5eb001900913c4c096e59c19c86f2abf7 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Thu, 1 Jun 2023 20:45:50 +0100 Subject: [PATCH] refactor: use `IsTerminal` from std instead of `is-terminal` crate --- Cargo.lock | 2 -- Cargo.toml | 2 -- crates/resolver-tests/Cargo.toml | 1 - crates/resolver-tests/tests/resolve.rs | 4 +++- src/cargo/core/shell.rs | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6acc7c682..4e8ddfbb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index 93cb041b1..01262c1db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/crates/resolver-tests/Cargo.toml b/crates/resolver-tests/Cargo.toml index 8a7cab113..e0efb9b6d 100644 --- a/crates/resolver-tests/Cargo.toml +++ b/crates/resolver-tests/Cargo.toml @@ -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 diff --git a/crates/resolver-tests/tests/resolve.rs b/crates/resolver-tests/tests/resolve.rs index df74826f0..02486bfb5 100644 --- a/crates/resolver-tests/tests/resolve.rs +++ b/crates/resolver-tests/tests/resolve.rs @@ -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 { diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index f74bde257..4d45e6098 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -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};