Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix nightly clippy rule needless_lifetimes #516

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

yukiiiteru
Copy link
Member

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
13 of 15 checks passed
@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