Resolve all clippy and rustc lint warnings across the feature powerset - #124
Merged
Conversation
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 Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves all
clippyandrustclint 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::pedanticerrors (the crate denies both atlib.rs:38):explicit_auto_derefinStringOrToken::read_span(&**self→self)..into_iter()before.collect()andString::from("")→String::new()in tests.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 inpointer.rspublic 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 — inlineusefor 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), andparse_index+ itsTokenimport (json).Verification
cargo hack --feature-powerset --no-dev-deps clippy→ 0 warningscargo clippy --all-features --all-targets→ cleancargo test --all-features→ 104 + 48 pass;cargo fmt --checkcleanOne note:
clippy --fixtried to reduceSome(ptr).unwrap_or_default()toptrin thedefault_lifetime_is_correctregression test (#111), which would remove what the test checks. That was reverted and given a local#[allow(clippy::unnecessary_literal_unwrap)]instead.