Skip to content

chore: fix nightly clippy rule needless_lifetimes#516

Merged
yukiiiteru merged 1 commit intocloudwego:mainfrom
yukiiiteru:chore/fix-clippy
Nov 1, 2024
Merged

chore: fix nightly clippy rule needless_lifetimes#516
yukiiiteru merged 1 commit intocloudwego:mainfrom
yukiiiteru:chore/fix-clippy

Conversation

@yukiiiteru
Copy link
Copy Markdown
Contributor

Motivation

The latest cargo-clippy adds a new rule:

error: the following explicit lifetimes could be elided: 's, 'cx
  --> volo/src/loadbalance/layer.rs:60:19
   |
60 |     async fn call<'s, 'cx>(
   |                   ^^  ^^^
61 |         &'s self,
   |          ^^
62 |         cx: &'cx mut Cx,
   |              ^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`

Solution

Fix them

```
error: the following explicit lifetimes could be elided: 's, 'cx
  --> volo/src/loadbalance/layer.rs:60:19
   |
60 |     async fn call<'s, 'cx>(
   |                   ^^  ^^^
61 |         &'s self,
   |          ^^
62 |         cx: &'cx mut Cx,
   |              ^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
```

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
@yukiiiteru yukiiiteru requested review from a team as code owners November 1, 2024 13:51
@yukiiiteru yukiiiteru merged commit b46274f into cloudwego:main Nov 1, 2024
@yukiiiteru yukiiiteru deleted the chore/fix-clippy branch November 1, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants