Skip to content

clippy: enable needless_lifetimes and extra_unused_lifetimes lints#5281

Merged
chenyukang merged 1 commit into
nervosnetwork:developfrom
eval-exec:ckb.clippy
Jul 20, 2026
Merged

clippy: enable needless_lifetimes and extra_unused_lifetimes lints#5281
chenyukang merged 1 commit into
nervosnetwork:developfrom
eval-exec:ckb.clippy

Conversation

@eval-exec

@eval-exec eval-exec commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Enable the clippy::needless_lifetimes and clippy::extra_unused_lifetimes lints by removing their -A (allow) flags from the Makefile, and fix the resulting clippy warnings.

What is changed and how it works?

  • Makefile: Remove -A clippy::needless_lifetimes and -A clippy::extra_unused_lifetimes from CLIPPY_OPTS, enabling these two lints.
  • tx-pool/src/process.rs: Remove the unnecessary 'a lifetime parameter from remove_orphan_txs_by_attach.
  • util/rational/src/tests.rs: Remove the unnecessary 'a lifetime parameter from impl<'a> From<&'a U256LeBytes> for U256.

Check List

  • No behavioral changes — only unused lifetime annotations are removed.

Copilot AI review requested due to automatic review settings July 13, 2026 08:34
@eval-exec
eval-exec requested a review from a team as a code owner July 13, 2026 08:34
@eval-exec
eval-exec requested review from chenyukang and quake and removed request for a team July 13, 2026 08:34
@eval-exec eval-exec changed the title clippy: remove -A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return clippy: enable needless_lifetimes and extra_unused_lifetimes lints Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 From impl signature to rely on lifetime elision instead of an explicit 'a.
  • Modified CLIPPY_OPTS in the root Makefile (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).

Comment thread Makefile
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
chenyukang merged commit 1aef582 into nervosnetwork:develop Jul 20, 2026
43 checks passed
@nervos-bot nervos-bot Bot mentioned this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants