Skip to content

Commit

Permalink
Use char::MIN and char::MAX instead of hardcoded constants
Browse files Browse the repository at this point in the history
These constants on the `char` type was stabilized today with Rust 1.83
  • Loading branch information
faern committed Nov 28, 2024
1 parent 09f5033 commit 4903bc9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
Expand Down

0 comments on commit 4903bc9

Please sign in to comment.