Enable a few more clippy lints - #10558
Open
emilk wants to merge 13 commits into
Open
Conversation
emilk
force-pushed
the
emilk/many-more-clippy-lints
branch
2 times, most recently
from
August 5, 2026 15:47
ca3b6c8 to
08b7c3e
Compare
Parenthesizes shifts mixed with `|`. Applied with `cargo clippy --fix`; `<<` already binds tighter than `|`, so this only makes the existing grouping explicit.
Ten intra-doc links were written with `'` instead of backticks, so they rendered as text instead of linking. The eight `['Err'](Result::Err)` cases become just [`Err`], since the explicit target is redundant once the link resolves. The remaining `["null", "string"]` is a JSON example rather than a link, so it is now inline code.
Replaces `"".to_string()` and friends with `String::new()`, applied with `cargo clippy --fix`. One site then tripped `unwrap_or_else(String::new)`, which became `unwrap_or_default()`.
Drops explicit `.into_iter()` from `for` loops, applied with `cargo clippy --fix`. One site then tripped `useless_vec`, so its `vec!` became an array.
Replaces `.map(f).unwrap_or_default()` with `.is_some_and(f)`, applied with `cargo clippy --fix`. The one negated case is spelled `is_none_or` instead, matching the style already used elsewhere.
Rewrites `if let Pat = x` on unit-like patterns as `x == Pat` or `matches!`, applied with `cargo clippy --fix`. The `tokenizer.next()` cases still call `next()` exactly once, so nothing changes about consumption.
Drops `#` from raw strings that contain no quotes, applied with `cargo clippy --fix`. Strings that do contain a `"` keep their hashes.
Uses `()` instead of `_` where the matched type is unit, applied with `cargo clippy --fix`.
emilk
force-pushed
the
emilk/many-more-clippy-lints
branch
from
August 5, 2026 16:01
08b7c3e to
dceda9d
Compare
emilk
marked this pull request as ready for review
August 5, 2026 16:08
Nests or-patterns, applied with `cargo clippy --fix`. Each group of collapsed arms already shared a body, so match order and reachability are unchanged.
Two of the `matches!` calls introduced by `equatable_if_let` read better as equality comparisons. The remaining ones stay: `InferredType` has no `PartialEq`, and `ParquetError` deliberately does not implement it (apache#4469).
Ten plain data strings left over from the `needless_raw_string_hashes` commit. Raw strings are kept where they still earn their prefix: regex and LIKE-pattern tables, and multi-line blocks that would otherwise need `\n`.
`arrow-cmp` was added after the workspace lints landed, so it was the only member without `[lints] workspace = true`. No fixes were needed: the crate is already clean under the full lint set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
emilk
force-pushed
the
emilk/many-more-clippy-lints
branch
from
August 5, 2026 16:48
c739058 to
a50db5b
Compare
Jefffrey
reviewed
Aug 6, 2026
Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
Jefffrey
approved these changes
Aug 6, 2026
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?
No issue in particular
[workspace.lints.clippy]#10552clippy::allow_attributes#10458Rationale for this change
There are a lot of lints we can enable to, which different abilities to:
What changes are included in this PR?
One commit per new lint (maybe easiest to review commit by commit!).
Let me know if you disagree with any of them.
I hope to add even more lints in later PRs.
Are these changes tested?
Covered by existing tests plus the clippy CI job.
Are there any user-facing changes?
No.