Repository navigation
lints: adopt the canonical lints block - #4
Merged
Merged
Conversation
jsonguard had no [lints] block at all - no unsafe_code key, no
unwrap_used/expect_used, no pedantic. It now carries the canonical recipe
(CLAUDE.core.md "Rust Lint Posture") with the panic-lint superset:
unsafe_code = "forbid" (the crate contains no unsafe)
correctness / suspicious = "deny"
unwrap_used / expect_used = "deny"
all + pedantic = "warn", with the canonical cast_* allows
Nothing in production code used unwrap or expect - every such site was in
a test module, which now carries the sanctioned
`#![cfg_attr(test, allow(...))]` (and the integration test its own
top-level allow).
What the new lints surfaced, all fixed at the source:
clippy::match_same_arms 2 arms merged (types.rs collapses three
`=> true` arms; text.rs folds the C0,
DEL/C1 and bidi escapes into one arm)
clippy::format_push_string 3 replaced by a write_unicode_escape
helper over fmt::Write, which is also
what let the three arms merge
clippy::unnested_or_patterns 1 fixed
plus 3 machine-applicable fixes from clippy --fix
One allow is added, with its reason recorded in the manifest:
needless_pass_by_value 6 sites. The public API is deliberately
`pub fn f<I: GuardInput>(input: I)` - generic-by-value is the seam that
lets a caller pass &str, &[u8] or String unchanged. Taking `&I` would
break every caller and defeat the trait, so this is a false positive
against the design, not a defect to fix.
Gate: cargo build --all-targets --all-features, cargo test --all-features
(171 tests) and --no-default-features, cargo clippy --workspace
--all-targets --all-features -- -D warnings, cargo fmt --check - all clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
lints: adopt the canonical lints block
jsonguard had no [lints] block at all - no unsafe_code key, no
unwrap_used/expect_used, no pedantic. It now carries the canonical recipe
(CLAUDE.core.md "Rust Lint Posture") with the panic-lint superset:
unsafe_code = "forbid" (the crate contains no unsafe)
correctness / suspicious = "deny"
unwrap_used / expect_used = "deny"
all + pedantic = "warn", with the canonical cast_* allows
Nothing in production code used unwrap or expect - every such site was in
a test module, which now carries the sanctioned
#.
What the new lints surfaced, all fixed at the source:
clippy::match_same_arms 2 arms merged (types.rs collapses three
=> truearms; text.rs folds the C0,DEL/C1 and bidi escapes into one arm)
clippy::format_push_string 3 replaced by a write_unicode_escape
helper over fmt::Write, which is also
what let the three arms merge
clippy::unnested_or_patterns 1 fixed
plus 3 machine-applicable fixes from clippy --fix
One allow is added, with its reason recorded in the manifest:
needless_pass_by_value 6 sites. The public API is deliberately
pub fn f<I: GuardInput>(input: I)- generic-by-value is the seam thatlets a caller pass &str, &[u8] or String unchanged. Taking
&Iwouldbreak every caller and defeat the trait, so this is a false positive
against the design, not a defect to fix.
Gate: cargo build --all-targets --all-features, cargo test --all-features
(171 tests) and --no-default-features, cargo clippy --workspace
--all-targets --all-features -- -D warnings, cargo fmt --check - all clean.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code