Resolve needless_lifetimes clippy lints

error: the following explicit lifetimes could be elided: 'a
       --> serde_derive/src/ser.rs:869:1
        |
    869 | / fn serialize_struct_variant<'a>(
    870 | |     context: StructVariant<'a>,
    871 | |     params: &Parameters,
    872 | |     fields: &[Field],
    873 | |     name: &str,
    874 | | ) -> Fragment {
        | |_____________^
        |
    help: replace with `'_` in generic arguments such as here
       --> serde_derive/src/ser.rs:870:28
        |
    870 |     context: StructVariant<'a>,
        |                            ^^
        = 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 clippy::all`

    error: the following explicit lifetimes could be elided: 'a
       --> serde_derive/src/ser.rs:953:1
        |
    953 | / fn serialize_struct_variant_with_flatten<'a>(
    954 | |     context: StructVariant<'a>,
    955 | |     params: &Parameters,
    956 | |     fields: &[Field],
    957 | |     name: &str,
    958 | | ) -> Fragment {
        | |_____________^
        |
    help: replace with `'_` in generic arguments such as here
       --> serde_derive/src/ser.rs:954:28
        |
    954 |     context: StructVariant<'a>,
        |                            ^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
This commit is contained in:
David Tolnay 2022-11-22 18:41:30 -08:00
parent 51ea34b217
commit ab230e6e44
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -866,8 +866,8 @@ enum StructVariant<'a> {
Untagged,
}
fn serialize_struct_variant<'a>(
context: StructVariant<'a>,
fn serialize_struct_variant(
context: StructVariant,
params: &Parameters,
fields: &[Field],
name: &str,
@ -950,8 +950,8 @@ fn serialize_struct_variant<'a>(
}
}
fn serialize_struct_variant_with_flatten<'a>(
context: StructVariant<'a>,
fn serialize_struct_variant_with_flatten(
context: StructVariant,
params: &Parameters,
fields: &[Field],
name: &str,