Skip to content

Commit 8e1ae68

Browse files
committed
Resolve some needless_lifetimes clippy lints
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 { |
1 parent 31000e1 commit 8e1ae68

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

serde/src/de/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ where
486486
}
487487
}
488488

489-
impl<'a> Expected for &'a str {
489+
impl Expected for &str {
490490
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
491491
formatter.write_str(self)
492492
}
493493
}
494494

495-
impl<'a> Display for Expected + 'a {
495+
impl Display for Expected + '_ {
496496
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
497497
Expected::fmt(self, formatter)
498498
}
@@ -1741,7 +1741,7 @@ pub trait SeqAccess<'de> {
17411741
}
17421742
}
17431743

1744-
impl<'de, 'a, A> SeqAccess<'de> for &'a mut A
1744+
impl<'de, A> SeqAccess<'de> for &mut A
17451745
where
17461746
A: ?Sized + SeqAccess<'de>,
17471747
{
@@ -1894,7 +1894,7 @@ pub trait MapAccess<'de> {
18941894
}
18951895
}
18961896

1897-
impl<'de, 'a, A> MapAccess<'de> for &'a mut A
1897+
impl<'de, A> MapAccess<'de> for &mut A
18981898
where
18991899
A: ?Sized + MapAccess<'de>,
19001900
{

serde/src/ser/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ macro_rules! fmt_primitives {
3535
/// }
3636
/// }
3737
/// ```
38-
impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> {
38+
impl<'a> Serializer for &mut fmt::Formatter<'a> {
3939
type Ok = ();
4040
type Error = fmt::Error;
4141
type SerializeSeq = Impossible<(), fmt::Error>;

serde_derive/src/internals/symbol.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl PartialEq<Symbol> for Ident {
4646
}
4747
}
4848

49-
impl<'a> PartialEq<Symbol> for &'a Ident {
49+
impl PartialEq<Symbol> for &Ident {
5050
fn eq(&self, word: &Symbol) -> bool {
5151
*self == word.0
5252
}
@@ -58,7 +58,7 @@ impl PartialEq<Symbol> for Path {
5858
}
5959
}
6060

61-
impl<'a> PartialEq<Symbol> for &'a Path {
61+
impl PartialEq<Symbol> for &Path {
6262
fn eq(&self, word: &Symbol) -> bool {
6363
self.is_ident(word.0)
6464
}

0 commit comments

Comments
 (0)