clippy: enable needless_lifetimes and extra_unused_lifetimes lints#5281
Merged
Conversation
…nyms -A clippy::needless_return
eval-exec
requested review from
chenyukang and
quake
and removed request for
a team
July 13, 2026 08:34
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to tighten the repository’s Clippy configuration by removing specific globally-allowed lints, and updates a couple of Rust call sites to avoid unnecessary explicit lifetimes.
Changes:
- Removed explicit lifetime parameters where they are unnecessary (to satisfy Clippy).
- Updated a
Fromimpl signature to rely on lifetime elision instead of an explicit'a. - Modified
CLIPPY_OPTSin the rootMakefile(but currently in a way that doesn’t match the PR title).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| util/rational/src/tests.rs | Removes an unnecessary explicit lifetime in a From<&T> impl. |
| tx-pool/src/process.rs | Removes an unnecessary explicit lifetime parameter from an async helper method. |
| Makefile | Updates global Clippy allow-list flags (currently inconsistent with the PR title). |
| VERBOSE := $(if ${CI},--verbose,) | ||
| CLIPPY_OPTS := -D warnings -D clippy::clone_on_ref_ptr -D clippy::redundant_clone -D clippy::enum_glob_use -D clippy::fallible_impl_from \ | ||
| -A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return -A clippy::needless_lifetimes -A clippy::extra_unused_lifetimes | ||
| -A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return |
chenyukang
approved these changes
Jul 20, 2026
Open
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.
What problem does this PR solve?
Enable the
clippy::needless_lifetimesandclippy::extra_unused_lifetimeslints by removing their-A(allow) flags from the Makefile, and fix the resulting clippy warnings.What is changed and how it works?
-A clippy::needless_lifetimesand-A clippy::extra_unused_lifetimesfromCLIPPY_OPTS, enabling these two lints.'alifetime parameter fromremove_orphan_txs_by_attach.'alifetime parameter fromimpl<'a> From<&'a U256LeBytes> for U256.Check List