From 4903bc9a7888655eef29d8831eb474d6fe9857d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Thu, 28 Nov 2024 16:04:15 +0100 Subject: [PATCH] Use `char::MIN` and `char::MAX` instead of hardcoded constants These constants on the `char` type was stabilized today with Rust 1.83 --- .github/workflows/build-and-test.yml | 2 +- Cargo.toml | 2 +- src/main.rs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d236118..c031aca 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,7 +16,7 @@ jobs: # TODO: Add and make Windows work in CI also os: [ubuntu-latest, macos-latest] # Keep MSRV in sync with rust-version in Cargo.toml - rust: [stable, beta, nightly, 1.79.0] + rust: [stable, beta, nightly, 1.83.0] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index f19c973..e863526 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://github.com/mullvad/unicop" license = "GPL-3.0" edition = "2021" -rust-version = "1.79.0" +rust-version = "1.83.0" [dependencies] miette = { version = "7.2.0", features = ["fancy"] } diff --git a/src/main.rs b/src/main.rs index 184588e..c71f888 100644 --- a/src/main.rs +++ b/src/main.rs @@ -158,9 +158,7 @@ fn main() -> anyhow::Result<()> { CharacterType::Range(range) => print_char_range(range), CharacterType::Bidi => print_char_range(rules::BIDI_CHARACTERS.iter().copied()), CharacterType::Block(block) => print_char_range(block.clone()), - // TODO: `char::MIN` and `char::MAX` are heading for stabilization. When they are - // stable we can replace these constants for those in std. - CharacterType::Anything => print_char_range('\0'..='\u{10ffff}'), + CharacterType::Anything => print_char_range(char::MIN..=char::MAX), } return Ok(()); }