From e467ebb0d77c712940bd25812f5f9886a99aedb4 Mon Sep 17 00:00:00 2001 From: Oakchris1955 <80592203+Oakchris1955@users.noreply.github.com> Date: Sun, 10 Dec 2023 04:25:43 +0200 Subject: [PATCH] Remove unnecessary is_terminal dependency (#149) * Remove unnecessary dependency Replaced the IsTerminal trait from the is_terminal crate with the built-in IO IsTerminal, which is stabilized since rustc 1.70.0 * Update test overflow Change minimum required Rust version to 1.70 * Update README and CHANGELOG --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 1 + Cargo.toml | 3 +-- README.md | 2 +- src/control.rs | 3 +-- src/lib.rs | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ac67dd..77d5bf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: strategy: matrix: os: ["ubuntu", "windows", "macos"] - version: ["stable", "beta", "1.63"] + version: ["stable", "beta", "1.70"] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index e873925..22ee2fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +- Document crate MSRV of `1.70`. # 2.0.4 - Switch from `winapi` to `windows-sys`. diff --git a/Cargo.toml b/Cargo.toml index b3200e5..46c7ab9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,14 +9,13 @@ homepage = "https://github.com/mackwic/colored" repository = "https://github.com/mackwic/colored" readme = "README.md" keywords = ["color", "string", "term", "ansi_term", "term-painter"] -rust-version = "1.63" +rust-version = "1.70" [features] # with this feature, no color will ever be written no-color = [] [dependencies] -is-terminal = "0.4" lazy_static = "1" [target.'cfg(windows)'.dependencies.windows-sys] diff --git a/README.md b/README.md index cd8f752..29096bc 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ providing a reference implementation, which greatly helped making this crate output correct strings. ## Minimum Supported Rust Version (MSRV) -The current MSRV is `1.63`, which is checked and enforced automatically via CI. This version may change in the future in minor version bumps, so if you require a specific Rust version you should use a restricted version requirement such as `~X.Y`. +The current MSRV is `1.70`, which is checked and enforced automatically via CI. This version may change in the future in minor version bumps, so if you require a specific Rust version you should use a restricted version requirement such as `~X.Y`. ## License diff --git a/src/control.rs b/src/control.rs index 80c8254..da09888 100644 --- a/src/control.rs +++ b/src/control.rs @@ -1,9 +1,8 @@ //! A couple of functions to enable and disable coloring. -use is_terminal::IsTerminal; use std::default::Default; use std::env; -use std::io; +use std::io::{self, IsTerminal}; use std::sync::atomic::{AtomicBool, Ordering}; /// Sets a flag to the console to use a virtual terminal environment. diff --git a/src/lib.rs b/src/lib.rs index 6be30bf..2ac0a3a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,6 @@ //! #![warn(missing_docs)] -extern crate is_terminal; #[macro_use] extern crate lazy_static;