Skip to content
Myr

Resolve some needless_lifetimes clippy lints

Before adoption: this commit came in with the history the project adopted, so no landing records it.

warning: the following explicit lifetimes could be elided: 'a --> serde/src/de/mod.rs:489:6 | 489 | impl<'a> Expected for &'a str { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 489 - impl<'a> Expected for &'a str { 489 + impl Expected for &str { | warning: the following explicit lifetimes could be elided: 'a --> serde/src/de/mod.rs:495:6 | 495 | impl<'a> Display for Expected + 'a { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 495 - impl<'a> Display for Expected + 'a { 495 + impl Display for Expected + '_ { | warning: the following explicit lifetimes could be elided: 'a --> serde/src/de/mod.rs:1744:11 | 1744 | impl<'de, 'a, A> SeqAccess<'de> for &'a mut A | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 1744 - impl<'de, 'a, A> SeqAccess<'de> for &'a mut A 1744 + impl<'de, A> SeqAccess<'de> for &mut A | warning: the following explicit lifetimes could be elided: 'a --> serde/src/de/mod.rs:1897:11 | 1897 | impl<'de, 'a, A> MapAccess<'de> for &'a mut A | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 1897 - impl<'de, 'a, A> MapAccess<'de> for &'a mut A 1897 + impl<'de, A> MapAccess<'de> for &mut A | warning: the following explicit lifetimes could be elided: 'a, 'b --> serde/src/ser/fmt.rs:38:6 | 38 | impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { | ^^ ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 38 - impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { 38 + impl Serializer for &mut fmt::Formatter<'_> { | warning: the following explicit lifetimes could be elided: 'a --> serde_derive/src/internals/symbol.rs:49:6 | 49 | impl<'a> PartialEq<Symbol> for &'a Ident { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 49 - impl<'a> PartialEq<Symbol> for &'a Ident { 49 + impl PartialEq<Symbol> for &Ident { | warning: the following explicit lifetimes could be elided: 'a --> serde_derive/src/internals/symbol.rs:61:6 | 61 | impl<'a> PartialEq<Symbol> for &'a Path { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 61 - impl<'a> PartialEq<Symbol> for &'a Path { 61 + impl PartialEq<Symbol> for &Path { |

authored by David Tolnay · committed by David Tolnay · parent 31000e1 · Browse files · 3 files+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+7 added−7 removed

  • other:+7 added−7 removed

3 files+7 added−7 removed

modified:serde/src/de/mod.rs+4 added-4 removed
484 unmodified lines
485 self.expecting(formatter)486 }487}488489impl<'a> Expected for &'a str {489impl Expected for &str {490 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {491 formatter.write_str(self)492 }493}494495impl<'a> Display for Expected + 'a {495impl Display for Expected + '_ {496 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {497 Expected::fmt(self, formatter)498 }499}
1240 unmodified lines
1740 None1741 }1742}17431744impl<'de, 'a, A> SeqAccess<'de> for &'a mut A1744impl<'de, A> SeqAccess<'de> for &mut A1745where1746 A: ?Sized + SeqAccess<'de>,1747{1748 type Error = A::Error;
144 unmodified lines
1893 None1894 }1895}18961897impl<'de, 'a, A> MapAccess<'de> for &'a mut A1897impl<'de, A> MapAccess<'de> for &mut A1898where1899 A: ?Sized + MapAccess<'de>,1900{1901 type Error = A::Error;
434 unmodified lines
modified:serde/src/ser/fmt.rs+1 added-1 removed
33 unmodified lines
34/// self.serialize(f)35/// }36/// }37/// ```38impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> {38impl<'a> Serializer for &mut fmt::Formatter<'a> {39 type Ok = ();40 type Error = fmt::Error;41 type SerializeSeq = Impossible<(), fmt::Error>;42 type SerializeTuple = Impossible<(), fmt::Error>;
128 unmodified lines
modified:serde_derive/src/internals/symbol.rs+2 added-2 removed
44 unmodified lines
45 self == word.046 }47}4849impl<'a> PartialEq<Symbol> for &'a Ident {49impl PartialEq<Symbol> for &Ident {50 fn eq(&self, word: &Symbol) -> bool {51 *self == word.052 }53}
3 unmodified lines
57 self.is_ident(word.0)58 }59}6061impl<'a> PartialEq<Symbol> for &'a Path {61impl PartialEq<Symbol> for &Path {62 fn eq(&self, word: &Symbol) -> bool {63 self.is_ident(word.0)64 }65}
6 unmodified lines