Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rust-1-100-std-apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stll/stdnum": patch
---

Raise the Rust crates' minimum supported Rust version to 1.100, use the standard `trim_prefix` and `trim_suffix` string helpers, and reject unused Cargo dependencies at build time.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ a pull request.
## Development setup

```bash
# Prerequisites: Bun and Rust 1.96
# Prerequisites: Bun and Rust 1.100
bun install
bun run rust:check # lint and test the Rust implementation
bun run codegen:check # verify generated bindings, types, and README
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version = "2.3.2"
edition = "2024"
# Minimum supported Rust version; CI uses the shared stable toolchain.
# Resolver "3" keeps dependency resolution MSRV-aware.
rust-version = "1.96"
rust-version = "1.100"
license = "Apache-2.0"
publish = false
repository = "https://github.com/stella/stdnum"
Expand All @@ -33,6 +33,9 @@ unused_macros = "deny"
unused_mut = "deny"
unused_variables = "deny"

[workspace.lints.cargo]
unused_dependencies = "deny"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
bare_urls = "deny"
Expand Down
2 changes: 1 addition & 1 deletion crates/stdnum-core/src/validators/additional_a_m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ fn compact_for(id: &str, value: &str) -> String {
}
compact
}
"cl.rut" => upper.strip_prefix("CL").unwrap_or(&upper).to_owned(),
"cl.rut" => upper.trim_prefix("CL").to_owned(),
"gt.nit" => upper.trim_start_matches('0').to_owned(),
"il.idnr" => format!("{compact:0>9}"),
"eg.tn" | "iq.nid" | "ir.nid" => compact
Expand Down
2 changes: 1 addition & 1 deletion crates/stdnum-core/src/validators/legacy_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ fn format_for(id: &str, value: &str) -> String {
span(&v, 7, v.len())
),
"no.mva" => {
let d = v.strip_suffix("MVA").unwrap_or(&v);
let d = v.trim_suffix("MVA");
format!(
"NO {} {} {} MVA",
span(d, 0, 3),
Expand Down
2 changes: 1 addition & 1 deletion crates/stdnum-wasm-size-fixture/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "stella-stdnum-wasm-size-fixture"
version = "0.0.0"
edition = "2024"
rust-version = "1.96"
rust-version = "1.100"
license = "Apache-2.0"
publish = false

Expand Down