From 66b2c52d103e3481b7fc4af91807083df0db1c44 Mon Sep 17 00:00:00 2001 From: Ghost Scripter Date: Thu, 27 Aug 2026 18:02:21 +0530 Subject: [PATCH] fix(providers): drop the redundant FromStr import that a newer stable denies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `src/providers/test.rs` imported `std::str::FromStr as _` alongside `use super::*`. The glob already brings it in — `use` items are private but visible to a child module, and `src/providers/mod.rs:15` imports `FromStr` for its own `impl FromStr for ProviderKind` — so the second import has always been redundant. Rust 1.98 reports it, `-D warnings` denies it, and the `Rust` job fails to compile the lib test. `ProviderKind::from_str` still resolves through the glob, so every call in this file is unchanged. This is not a regression in any branch. `main` carries the same line and last ran CI on 2026-08-18, when `stable` did not report it; the toolchain moved underneath it. Any PR opened since then fails on it — PR #4 is the one that surfaced it, on a file it does not touch. Fixing it here rather than in that PR keeps the blame legible and unblocks every other branch at the same time. Verified on three toolchains, matching the three CI lanes: - 1.98.0 (nearest local stable): `cargo clippy --all-targets --all-features -- -D warnings` clean, `cargo test --all-features` and `cargo test` both 155 pass, `cargo build --all-targets --all-features` clean. - 1.88 (the declared MSRV, `rust-version` in Cargo.toml): `cargo build --all-targets --all-features` clean — the glob resolves the trait there too, so removing the import does not cost MSRV support. - `cargo fmt --all -- --check` clean. --- src/providers/test.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/test.rs b/src/providers/test.rs index c76e0a0..4b58923 100644 --- a/src/providers/test.rs +++ b/src/providers/test.rs @@ -3,8 +3,11 @@ #![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] use std::collections::HashMap; -use std::str::FromStr as _; +// `FromStr` is NOT imported here: `use super::*` already brings the parent +// module's own `use std::str::FromStr` into scope, so a second import is +// redundant. Rust 1.98 started reporting it, and `-D warnings` turned that +// report into a build failure — see the commit message. use super::*; fn lookup(pairs: &[(&str, &str)]) -> impl Fn(&str) -> Option + use<> {