Skip to content

Resolve all clippy and rustc lint warnings across the feature powerset - #124

Merged
asmello merged 1 commit into
mainfrom
lint/0.8.1-cleanup
Jul 26, 2026
Merged

Resolve all clippy and rustc lint warnings across the feature powerset#124
asmello merged 1 commit into
mainfrom
lint/0.8.1-cleanup

Conversation

@asmello

@asmello asmello commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Resolves all clippy and rustc lint warnings across the full feature powerset, prep for the next release. No public API changes — internal/tooling only, so no version bump here.

What was flagged & fixed

clippy::all / clippy::pedantic errors (the crate denies both at lib.rs:38):

  • explicit_auto_deref in StringOrToken::read_span (&**selfself).
  • Redundant .into_iter() before .collect() and String::from("")String::new() in tests.
  • Bare URLs in README.md (included as crate docs via #![doc = include_str!]) wrapped in <…>.

Newer-toolchain rustc lint mismatched_lifetime_syntaxes (9 sites): made elided output lifetimes explicit in pointer.rs public signatures — Tokens<'_>, Token<'_>, Components<'_>. Purely syntactic; the API is unchanged.

#[macro_use] extern crate alloc: removed. It was unused in the minimal feature set (warning under --no-default-features). vec!/format! are now imported where used — inline use for single-use sites, matching the codebase's existing style.

Feature-combination dead code: gated items so they don't warn when their consumer features are off — Assigned (json/toml), and parse_index + its Token import (json).

Verification

  • cargo hack --feature-powerset --no-dev-deps clippy0 warnings
  • cargo clippy --all-features --all-targetsclean
  • cargo test --all-features → 104 + 48 pass; cargo fmt --check clean

One note: clippy --fix tried to reduce Some(ptr).unwrap_or_default() to ptr in the default_lifetime_is_correct regression test (#111), which would remove what the test checks. That was reverted and given a local #[allow(clippy::unnecessary_literal_unwrap)] instead.

Clean bill of lints with no public API changes:

- Fix the `clippy::all`/`clippy::pedantic` errors: an `explicit_auto_deref`
  in `StringOrToken::read_span`, redundant `.into_iter()` and
  `String::from("")` in tests, and bare URLs in the README (included as crate
  docs).
- Make elided output lifetimes explicit in `pointer.rs` public signatures
  (`Tokens<'_>`, `Token<'_>`, `Components<'_>`), silencing the newer
  `mismatched_lifetime_syntaxes` lint. Purely syntactic; no API change.
- Drop the blanket `#[macro_use] extern crate alloc`, which was unused in the
  minimal feature set. Import `vec!`/`format!` where used instead (inline for
  single-use sites, matching the existing style).
- Gate feature-only items so they don't warn as dead code when their consumer
  features are off: `Assigned` (json/toml), and `parse_index` plus its `Token`
  import (json).

Verified clean with `cargo hack --feature-powerset clippy` and
`cargo clippy --all-features --all-targets`. Preserves the intent of the
`default_lifetime_is_correct` regression test (kept `unwrap_or_default`, with a
local `#[allow]`, rather than letting clippy --fix reduce it away).

Claude-Session: https://claude.ai/code/session_01XGvHsB4a2dxDVUQDGBScnW
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.6%. Comparing base (c96d8dd) to head (6a64eb0).

Files with missing lines Patch % Lines
src/index.rs 83.3% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/assign.rs 97.4% <ø> (ø)
src/pointer.rs 95.8% <100.0%> (ø)
src/resolve.rs 92.4% <ø> (ø)
src/token.rs 98.3% <100.0%> (-0.1%) ⬇️
src/index.rs 90.6% <83.3%> (-0.3%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asmello
asmello merged commit 0018d9e into main Jul 26, 2026
21 checks passed
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.

2 participants