Enable more clippy lints (part 1/3) - #24848
Open
emilk wants to merge 3 commits into
Open
Conversation
emilk
force-pushed
the
emilk/enable-more-clippy-lints-4
branch
from
September 1, 2026 12:46
c24d083 to
c866451
Compare
emilk
force-pushed
the
emilk/enable-more-clippy-lints-4
branch
2 times, most recently
from
September 1, 2026 14:18
f32b894 to
e448a28
Compare
emilk
marked this pull request as ready for review
September 1, 2026 14:19
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24848 +/- ##
==========================================
- Coverage 81.74% 81.74% -0.01%
==========================================
Files 1128 1128
Lines 416644 416646 +2
Branches 416644 416646 +2
==========================================
- Hits 340592 340589 -3
- Misses 55995 55998 +3
- Partials 20057 20059 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
…this might be a bit big 😬 let me know if I should break it up. (each commit in itself is pretty reviewable though) |
emilk
force-pushed
the
emilk/enable-more-clippy-lints-4
branch
from
September 7, 2026 21:16
e448a28 to
e686aea
Compare
emilk
force-pushed
the
emilk/enable-more-clippy-lints-4
branch
from
September 8, 2026 12:37
6e4144a to
770ec5d
Compare
`String::new()` instead of `"".to_string()` / `"".to_owned()` / `"".into()`, which skips the copy-from-empty-slice path. All sites fixed by `cargo clippy --fix`.
`Ok(())` instead of `Ok(_)` where the payload is `()`, so the pattern stops matching silently if the type ever gains a payload.
Dropped `else` blocks after a branch that already diverges, removing one level of indentation at each site.
emilk
force-pushed
the
emilk/enable-more-clippy-lints-4
branch
from
September 8, 2026 14:29
770ec5d to
33b2e9e
Compare
This was referenced Sep 8, 2026
Contributor
Author
|
Split into three parts, one PR each: |
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.
Which issue does this PR close?
Clippychecks in CI #18467.Rationale for this change
Continuing the work in:
This PR was too big, so it is now part 1 of 3. The other parts are stacked on top of it:
Turn on more
clippy::pedanticlints from the opt-out list inCargo.toml.What changes are included in this PR?
One commit per lint, each removing its
"allow"line fromCargo.tomlandfixing every site. Review one commit at a time!
Let me know if you disagree with any and I'll revert it.
manual_string_newString::new()instead of"".to_string()/"".to_owned()/"".into()ignored_unit_patternsOk(())instead ofOk(_), so the pattern stops matching if a payload is ever addedredundant_elseelseafter a diverging branchWhat is the testing strategy for this PR?
Clippy is clean both with
--all-featuresand with default features (the latteris what caught a
cfg-gated site). The changes are mechanical, so no new tests.Are there any user-facing changes?
No