Skip to content

Commit

Permalink
Update & fix msrv (djudd#23)
Browse files Browse the repository at this point in the history
* Update & fix msrv
* Add msrv check to build
  • Loading branch information
djudd authored Jul 19, 2022
1 parent 745e7a2 commit 03ffdee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
stable:

runs-on: ubuntu-latest

Expand All @@ -27,3 +27,19 @@ jobs:
run: cargo clippy --verbose
- name: Run rustfmt
run: cargo fmt --check --verbose

msrv:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install minimum supported Rust version
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.52.1
- name: Typecheck
run: cargo check --verbose

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories = ["parsing", "text-processing", "command-line-utilities",]
license = "Apache-2.0"
repository = "https://github.com/djudd/human-name"
documentation = "https://docs.rs/human_name/"
rust-version = "1.49"
rust-version = "1.52"

[dependencies]
unicode-segmentation = "1.9"
Expand Down
9 changes: 7 additions & 2 deletions src/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,17 @@ fn casefolded_alphas(

#[inline]
pub fn eq_casefolded_alpha_prefix(a: &str, b: &str) -> bool {
!std::iter::zip(casefolded_alphas(a), casefolded_alphas(b)).any(|(a, b)| a != b)
!casefolded_alphas(a)
.zip(casefolded_alphas(b))
.any(|(a, b)| a != b)
}

#[inline]
pub fn eq_casefolded_alpha_suffix(a: &str, b: &str) -> bool {
!std::iter::zip(casefolded_alphas(a).rev(), casefolded_alphas(b).rev()).any(|(a, b)| a != b)
!casefolded_alphas(a)
.rev()
.zip(casefolded_alphas(b).rev())
.any(|(a, b)| a != b)
}

// Specialized for name-casing
Expand Down

0 comments on commit 03ffdee

Please sign in to comment.