Skip to content

chore(volo-grpc): fix clippy rule needless_lifetimes#507

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

chore(volo-grpc): fix clippy rule needless_lifetimes#507
yukiiiteru merged 1 commit intocloudwego:mainfrom
yukiiiteru:chore/clippy-fix

Conversation

@yukiiiteru
Copy link
Copy Markdown
Contributor

Motivation

error: the following explicit lifetimes could be elided: 'a
   --> volo-grpc/src/metadata/key.rs:207:6
    |
207 | impl<'a, VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &'a MetadataKey<VE> {
    |      ^^                                                     ^^
    |
    = 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)]`
help: elide the lifetimes
    |
207 - impl<'a, VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &'a MetadataKey<VE> {
207 + impl<VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &MetadataKey<VE> {
    |

Solution

Fix them

error: the following explicit lifetimes could be elided: 'a
   --> volo-grpc/src/metadata/key.rs:207:6
    |
207 | impl<'a, VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &'a MetadataKey<VE> {
    |      ^^                                                     ^^
    |
    = 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)]`
help: elide the lifetimes
    |
207 - impl<'a, VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &'a MetadataKey<VE> {
207 + impl<VE: ValueEncoding> PartialEq<MetadataKey<VE>> for &MetadataKey<VE> {
    |

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
@yukiiiteru yukiiiteru requested review from a team as code owners October 8, 2024 07:01
@yukiiiteru yukiiiteru merged commit dde1176 into cloudwego:main Oct 8, 2024
@yukiiiteru yukiiiteru deleted the chore/clippy-fix branch October 8, 2024 07:22
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