Skip to content

chore(rust): adopt Rust 1.100 trim helpers and the unused-dependency lint - #317

Merged
jan-kubica merged 1 commit into
mainfrom
chore/rust-1-100-std-apis
Nov 19, 2026
Merged

jan-kubica merged 1 commit into
mainfrom
chore/rust-1-100-std-apis

Conversation

@jan-kubica

@jan-kubica jan-kubica commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace strip_prefix(p).unwrap_or(s) / strip_suffix(p).unwrap_or(s) with the standard trim_prefix / trim_suffix (stable since Rust 1.100). Same result: the prefix or suffix is removed once if present, otherwise the input is returned unchanged.
  • Enable Cargo's built-in cargo::unused_dependencies lint at deny in [workspace.lints.cargo] (members already inherit workspace lints). It reports a normal or build dependency that no target of the package uses, when all of its targets are built (cargo check, cargo clippy --all-targets, cargo build); partial builds such as --lib report nothing. warn would not fail CI, because -D warnings reaches rustc lints only.
  • Raise every declared rust-version to 1.100 (required by the new string helpers).
  • Patch changeset included.

Test plan

  • CI (clippy, tests, wasm builds) on the 1.100.0 toolchain.

Summary by CodeRabbit

  • Bug Fixes
    • Improved prefix and suffix trimming when compacting Chilean RUT and formatting Norwegian VAT numbers.
  • Chores
    • Updated the minimum supported Rust version to 1.100.
    • Added a build-time check that rejects unused Cargo dependencies.

…lint

Replace strip_prefix/strip_suffix followed by unwrap_or(self) with the
standard trim_prefix/trim_suffix, raise rust-version to 1.100, and deny
cargo::unused_dependencies across the workspace.
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The workspace and WASM size fixture now require Rust 1.100. The workspace denies unused Cargo dependencies. Two validator branches now use Rust string-trimming helpers, and the changeset records the updates.

Changes: Rust version and validator updates

Layer / File(s) Summary
Rust requirement and lint
Cargo.toml, crates/stdnum-wasm-size-fixture/Cargo.toml, CONTRIBUTING.md, .changeset/rust-1-100-std-apis.md
The workspace and fixture minimum Rust version changes from 1.96 to 1.100. The workspace denies unused dependencies. Contributor guidance and the changeset reflect the update.
Validator trimming helpers
crates/stdnum-core/src/validators/additional_a_m.rs, crates/stdnum-core/src/validators/legacy_specs.rs
cl.rut compaction uses trim_prefix("CL"). Norwegian VAT formatting uses trim_suffix("MVA").

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • stella/stdnum#316: Pins the Rust toolchain to 1.100.0 and updates CI Rust versions, aligning with this PR’s Rust 1.100 requirement.
Merge Risk: Low · up to e191f

The Rust 1.100 minimum is not enforced for most member crates. With the pinned toolchain nothing breaks, but an older compiler would fail with a less clear error. Adding rust-version.workspace = true to the members is a small follow-up.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jan-kubica
jan-kubica enabled auto-merge (squash) November 19, 2026 08:57
@jan-kubica
jan-kubica merged commit 5a2aca4 into main Nov 19, 2026
15 of 16 checks passed
@jan-kubica
jan-kubica deleted the chore/rust-1-100-std-apis branch November 19, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant