Skip to content

fix(providers): drop the redundant FromStr import that a newer stable denies - #7

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/stale-fromstr-import-on-stable
Aug 27, 2026
Merged

fix(providers): drop the redundant FromStr import that a newer stable denies#7
senamakel merged 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/stale-fromstr-import-on-stable

Conversation

@CodeGhost21

@CodeGhost21 CodeGhost21 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What this is

One import. src/providers/test.rs:6 had use std::str::FromStr as _; sitting next to use super::*, and the glob already brings FromStr in — use items are private but visible to a child module, and src/providers/mod.rs:15 imports it for impl FromStr for ProviderKind. The second import has always been redundant.

Rust 1.98 started reporting it, -D warnings denies it, and the Rust job fails to compile the lib test:

error: unused import: `std::str::FromStr`
 --> src/providers/test.rs:6:5
  = note: `-D unused-imports` implied by `-D warnings`

ProviderKind::from_str still resolves through the glob, so the three call sites in that file are untouched.

This is a main-branch breakage, not a PR's

Worth being explicit, because the symptom points at the wrong place. main carries this line and last ran CI on 2026-08-18, green — stable did not report it then. stable moved. Every branch opened since fails on it.

#4 is where it showed up, on a file that PR does not touch. Fixing it on main rather than inside #4 keeps that legible and unblocks every other branch at once — #4 should go green on its next run once this lands.

Verification

Three toolchains, matching the three CI lanes:

lane command result
Rust cargo clippy --all-targets --all-features -- -D warnings (1.98.0) clean
Rust cargo test --all-features and cargo test (1.98.0) 155 pass each
Rust cargo build --all-targets --all-features (1.98.0) clean
Minimum supported Rust version cargo build --all-targets --all-features (1.88, the declared rust-version) clean
cargo fmt --all -- --check clean

The MSRV check is the one that mattered: the glob resolves the trait on 1.88 too, so dropping the import costs no MSRV support.

I left a comment in place of the import so the next person does not re-add it.

Summary by CodeRabbit

  • Chores
    • Removed a redundant internal import.
    • Updated inline documentation to clarify import behavior and prevent build failures caused by warnings.

… denies

`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 tinyhumansai#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.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6557a702-4e02-47ff-835a-73b7a3739474

📥 Commits

Reviewing files that changed from the base of the PR and between d2e6b77 and 66b2c52.

📒 Files selected for processing (1)
  • src/providers/test.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The provider test module removes a redundant FromStr import and adds a comment explaining that use super::* already provides the trait.

Changes

Provider test cleanup

Layer / File(s) Summary
Remove redundant FromStr import
src/providers/test.rs
The test module removes the duplicate import and documents the Rust 1.98 warning behavior under -D warnings.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 66b2c

This localized cleanup removes a redundant import without changing production behavior, and no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: senamakel

Poem

A rabbit found an import twice,
And trimmed the code with careful eyes.
The parent scope now lends a paw,
No warning trips the build anymore,
So hops proceed through tests and more.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the redundant FromStr import because newer Rust versions deny it under warnings-as-errors.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@tinysweeper

tinysweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown

How this change flows

0 changed behaviours across 11 relationships. 5 surrounding behaviours are shown (39 graph nodes walked). 15 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["Vercel"]:::impacted
  n1["lookup"]:::impacted
  n2["credentials_from"]:::impacted
  n3["...sing_key_names_every_variable_it_searched"]:::impacted
  n4["the_prefixed_variable_wins"]:::impacted
  n2 -->|calls| n1
  n3 -->|uses| n0
  n3 -->|calls| n1
  n3 -->|tests| n1
  n3 -->|calls| n2
  n3 -->|tests| n2
  n4 -->|uses| n0
  n4 -->|calls| n1
  n4 -->|tests| n1
  n4 -->|calls| n2
  n4 -->|tests| n2
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@CodeGhost21

Copy link
Copy Markdown
Contributor Author

@senamakel — this needs a maintainer to merge; I only have pull on this repo.

It is one line, and it is what is holding your #4 red. src/providers/test.rs:6 had a use std::str::FromStr as _ that the use super::* glob already provides. Rust 1.98 started reporting it and -D warnings denies it, so the lib test fails to compile.

Worth stressing: this is not #4's doing. main carries the same line and last ran CI on 2026-08-18, when stable still let it pass — so main is red today too, and every branch opened since inherits it. #4 just happened to be the PR that surfaced it, on a file it does not touch.

Green on all five lanes here, including Minimum supported Rust version on 1.88 — the glob resolves the trait there too, so dropping the import costs no MSRV support. The two approvals showing are tinysweeper and coderabbitai, both bots, so this still wants a human look.

Once it lands, a re-run of #4 should clear that lane with no change to your commits.

@senamakel
senamakel merged commit e068402 into tinyhumansai:main Aug 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants