Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Resolve some needless_lifetimes clippy lints
Browse files Browse the repository at this point in the history
    warning: the following explicit lifetimes could be elided: 'a
       --> src/de.rs:102:11
        |
    102 | impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
        |           ^^                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
        = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
    help: elide the lifetimes
        |
    102 - impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
    102 + impl<'de> de::Deserializer<'de> for &mut Deserializer<'de> {
        |

    warning: the following explicit lifetimes could be elided: 'a, 's
       --> src/ser.rs:319:6
        |
    319 | impl<'s, 'a> ser::SerializeSeq for &'s mut Serializer<'a> {
        |      ^^  ^^                         ^^                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    319 - impl<'s, 'a> ser::SerializeSeq for &'s mut Serializer<'a> {
    319 + impl ser::SerializeSeq for &mut Serializer<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'a, 's
       --> src/ser.rs:336:6
        |
    336 | impl<'s, 'a> ser::SerializeTuple for &'s mut Serializer<'a> {
        |      ^^  ^^                           ^^                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    336 - impl<'s, 'a> ser::SerializeTuple for &'s mut Serializer<'a> {
    336 + impl ser::SerializeTuple for &mut Serializer<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'a, 's
       --> src/ser.rs:353:6
        |
    353 | impl<'s, 'a> ser::SerializeTupleStruct for &'s mut Serializer<'a> {
        |      ^^  ^^                                 ^^                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    353 - impl<'s, 'a> ser::SerializeTupleStruct for &'s mut Serializer<'a> {
    353 + impl ser::SerializeTupleStruct for &mut Serializer<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'a, 's
       --> src/ser.rs:391:6
        |
    391 | impl<'s, 'a> ser::SerializeMap for &'s mut Serializer<'a> {
        |      ^^  ^^                         ^^                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    391 - impl<'s, 'a> ser::SerializeMap for &'s mut Serializer<'a> {
    391 + impl ser::SerializeMap for &mut Serializer<'_> {
        |

    warning: the following explicit lifetimes could be elided: 's, 'a
       --> src/ser.rs:415:6
        |
    415 | impl<'s, 'a> ser::SerializeStruct for &'s mut Serializer<'a> {
        |      ^^  ^^                            ^^                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    415 - impl<'s, 'a> ser::SerializeStruct for &'s mut Serializer<'a> {
    415 + impl ser::SerializeStruct for &mut Serializer<'_> {
        |
  • Loading branch information
dtolnay committed Oct 7, 2024
1 parent 4debfdd commit 4e48932
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<'de> Deserializer<'de> {
}
}

impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
impl<'de> de::Deserializer<'de> for &mut Deserializer<'de> {
type Error = Error;

forward_to_deserialize_any! {
Expand Down
10 changes: 5 additions & 5 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub struct Variant<'s, 'a: 's> {
end: Token,
}

impl<'s, 'a> ser::SerializeSeq for &'s mut Serializer<'a> {
impl<'a> ser::SerializeSeq for &mut Serializer<'a> {
type Ok = ();
type Error = Error;

Expand All @@ -333,7 +333,7 @@ impl<'s, 'a> ser::SerializeSeq for &'s mut Serializer<'a> {
}
}

impl<'s, 'a> ser::SerializeTuple for &'s mut Serializer<'a> {
impl<'a> ser::SerializeTuple for &mut Serializer<'a> {
type Ok = ();
type Error = Error;

Expand All @@ -350,7 +350,7 @@ impl<'s, 'a> ser::SerializeTuple for &'s mut Serializer<'a> {
}
}

impl<'s, 'a> ser::SerializeTupleStruct for &'s mut Serializer<'a> {
impl<'a> ser::SerializeTupleStruct for &mut Serializer<'a> {
type Ok = ();
type Error = Error;

Expand Down Expand Up @@ -388,7 +388,7 @@ impl<'s, 'a> ser::SerializeTupleVariant for Variant<'s, 'a> {
}
}

impl<'s, 'a> ser::SerializeMap for &'s mut Serializer<'a> {
impl<'a> ser::SerializeMap for &mut Serializer<'a> {
type Ok = ();
type Error = Error;

Expand All @@ -412,7 +412,7 @@ impl<'s, 'a> ser::SerializeMap for &'s mut Serializer<'a> {
}
}

impl<'s, 'a> ser::SerializeStruct for &'s mut Serializer<'a> {
impl<'a> ser::SerializeStruct for &mut Serializer<'a> {
type Ok = ();
type Error = Error;

Expand Down

0 comments on commit 4e48932

Please sign in to comment.