From d37f68ffef363f0e00b4dc93dec4b99755880196 Mon Sep 17 00:00:00 2001 From: Arjen <4867268+atezet@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:43:32 +0200 Subject: [PATCH 1/3] Remove unnecessary lazy_static dependency --- Cargo.toml | 4 +--- README.md | 2 +- src/control.rs | 5 ++--- src/lib.rs | 3 --- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 97f9eb7..d873024 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,14 +9,12 @@ 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.70" +rust-version = "1.80" [features] # with this feature, no color will ever be written no-color = [] -[dependencies] -lazy_static = "1" [target.'cfg(windows)'.dependencies.windows-sys] version = "0.48" diff --git a/README.md b/README.md index 9b8a30f..9dc33d3 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ providing a reference implementation, which greatly helped making this crate output correct strings. ## Minimum Supported Rust Version (MSRV) -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`. +The current MSRV is `1.80`, 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 da09888..57b8063 100644 --- a/src/control.rs +++ b/src/control.rs @@ -4,6 +4,7 @@ use std::default::Default; use std::env; use std::io::{self, IsTerminal}; use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::LazyLock; /// Sets a flag to the console to use a virtual terminal environment. /// @@ -78,10 +79,8 @@ pub fn unset_override() { SHOULD_COLORIZE.unset_override() } -lazy_static! { /// The persistent [`ShouldColorize`]. - pub static ref SHOULD_COLORIZE: ShouldColorize = ShouldColorize::from_env(); -} +pub static SHOULD_COLORIZE: LazyLock = LazyLock::new(ShouldColorize::from_env); impl Default for ShouldColorize { fn default() -> ShouldColorize { diff --git a/src/lib.rs b/src/lib.rs index 6942868..5db0516 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,9 +29,6 @@ //! modify them. #![warn(missing_docs)] -#[macro_use] -extern crate lazy_static; - #[cfg(test)] extern crate rspec; From ef3b3b41d0ac7eb0c3b1e23c6acccd29c49cfca0 Mon Sep 17 00:00:00 2001 From: Arjen <4867268+atezet@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:33:45 +0200 Subject: [PATCH 2/3] Upgrade MSRV in tests --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e1da8f..9dd8c17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: os: ["ubuntu", "windows", "macos"] - version: ["stable", "beta", "1.70"] + version: ["stable", "beta", "1.80"] steps: - name: Checkout repository uses: actions/checkout@v3 @@ -59,4 +59,3 @@ jobs: uses: actions/checkout@v3 - name: Check semver uses: obi1kenobi/cargo-semver-checks-action@v2 - From 250b7915acf4059bbfa70c1abd7f10b4aae41bb6 Mon Sep 17 00:00:00 2001 From: Arjen <4867268+atezet@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:30:08 +0200 Subject: [PATCH 3/3] Bump version to 3.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d873024..3652939 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "colored" description = "The most simple way to add colors in your terminal" -version = "2.1.0" +version = "3.0.0" edition = "2021" authors = ["Thomas Wickham "] license = "MPL-2.0"