Skip to content

Commit 8854102

Browse files
committed
Resolve needless_lifetimes clippy lints
warning: the following explicit lifetimes could be elided: 'a --> src/de.rs:138:11 | 138 | 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 | 138 - impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> { 138 + impl<'de> de::Deserializer<'de> for &mut Deserializer<'de> { | warning: the following explicit lifetimes could be elided: 'a --> src/de.rs:516:11 | 516 | impl<'de, 'a> SeqAccess<'de> for CommaSeparated<'a, '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 | 516 - impl<'de, 'a> SeqAccess<'de> for CommaSeparated<'a, 'de> { 516 + impl<'de> SeqAccess<'de> for CommaSeparated<'_, 'de> { | warning: the following explicit lifetimes could be elided: 'a --> src/de.rs:539:11 | 539 | impl<'de, 'a> MapAccess<'de> for CommaSeparated<'a, 'de> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 539 - impl<'de, 'a> MapAccess<'de> for CommaSeparated<'a, 'de> { 539 + impl<'de> MapAccess<'de> for CommaSeparated<'_, 'de> { | warning: the following explicit lifetimes could be elided: 'a --> src/de.rs:589:11 | 589 | impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 589 - impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> { 589 + impl<'de> EnumAccess<'de> for Enum<'_, 'de> { | warning: the following explicit lifetimes could be elided: 'a --> src/de.rs:612:11 | 612 | impl<'de, 'a> VariantAccess<'de> for Enum<'a, 'de> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 612 - impl<'de, 'a> VariantAccess<'de> for Enum<'a, 'de> { 612 + impl<'de> VariantAccess<'de> for Enum<'_, 'de> { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:33:6 | 33 | impl<'a> ser::Serializer for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 33 - impl<'a> ser::Serializer for &'a mut Serializer { 33 + impl ser::Serializer for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:311:6 | 311 | impl<'a> ser::SerializeSeq for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 311 - impl<'a> ser::SerializeSeq for &'a mut Serializer { 311 + impl ser::SerializeSeq for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:336:6 | 336 | impl<'a> ser::SerializeTuple for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 336 - impl<'a> ser::SerializeTuple for &'a mut Serializer { 336 + impl ser::SerializeTuple for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:357:6 | 357 | impl<'a> ser::SerializeTupleStruct for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 357 - impl<'a> ser::SerializeTupleStruct for &'a mut Serializer { 357 + impl ser::SerializeTupleStruct for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:386:6 | 386 | impl<'a> ser::SerializeTupleVariant for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 386 - impl<'a> ser::SerializeTupleVariant for &'a mut Serializer { 386 + impl ser::SerializeTupleVariant for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:414:6 | 414 | impl<'a> ser::SerializeMap for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 414 - impl<'a> ser::SerializeMap for &'a mut Serializer { 414 + impl ser::SerializeMap for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:455:6 | 455 | impl<'a> ser::SerializeStruct for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 455 - impl<'a> ser::SerializeStruct for &'a mut Serializer { 455 + impl ser::SerializeStruct for &mut Serializer { | warning: the following explicit lifetimes could be elided: 'a --> src/ser.rs:479:6 | 479 | impl<'a> ser::SerializeStructVariant for &'a mut Serializer { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 479 - impl<'a> ser::SerializeStructVariant for &'a mut Serializer { 479 + impl ser::SerializeStructVariant for &mut Serializer { |
1 parent 5954e60 commit 8854102

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/de.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'de> Deserializer<'de> {
135135
}
136136
}
137137

138-
impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
138+
impl<'de> de::Deserializer<'de> for &mut Deserializer<'de> {
139139
type Error = Error;
140140

141141
// Look at the input data to decide what Serde data model type to
@@ -513,7 +513,7 @@ impl<'a, 'de> CommaSeparated<'a, 'de> {
513513

514514
// `SeqAccess` is provided to the `Visitor` to give it the ability to iterate
515515
// through elements of the sequence.
516-
impl<'de, 'a> SeqAccess<'de> for CommaSeparated<'a, 'de> {
516+
impl<'de> SeqAccess<'de> for CommaSeparated<'_, 'de> {
517517
type Error = Error;
518518

519519
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>>
@@ -536,7 +536,7 @@ impl<'de, 'a> SeqAccess<'de> for CommaSeparated<'a, 'de> {
536536

537537
// `MapAccess` is provided to the `Visitor` to give it the ability to iterate
538538
// through entries of the map.
539-
impl<'de, 'a> MapAccess<'de> for CommaSeparated<'a, 'de> {
539+
impl<'de> MapAccess<'de> for CommaSeparated<'_, 'de> {
540540
type Error = Error;
541541

542542
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
@@ -586,7 +586,7 @@ impl<'a, 'de> Enum<'a, 'de> {
586586
//
587587
// Note that all enum deserialization methods in Serde refer exclusively to the
588588
// "externally tagged" enum representation.
589-
impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> {
589+
impl<'de> EnumAccess<'de> for Enum<'_, 'de> {
590590
type Error = Error;
591591
type Variant = Self;
592592

@@ -609,7 +609,7 @@ impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> {
609609

610610
// `VariantAccess` is provided to the `Visitor` to give it the ability to see
611611
// the content of the single variant that it decided to deserialize.
612-
impl<'de, 'a> VariantAccess<'de> for Enum<'a, 'de> {
612+
impl<'de> VariantAccess<'de> for Enum<'_, 'de> {
613613
type Error = Error;
614614

615615
// If the `Visitor` expected this variant to be a unit variant, the input

src/ser.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ where
3030
Ok(serializer.output)
3131
}
3232

33-
impl<'a> ser::Serializer for &'a mut Serializer {
33+
impl ser::Serializer for &mut Serializer {
3434
// The output type produced by this `Serializer` during successful
3535
// serialization. Most serializers that produce text or binary output should
3636
// set `Ok = ()` and serialize into an `io::Write` or buffer contained
@@ -308,7 +308,7 @@ impl<'a> ser::Serializer for &'a mut Serializer {
308308
//
309309
// This impl is SerializeSeq so these methods are called after `serialize_seq`
310310
// is called on the Serializer.
311-
impl<'a> ser::SerializeSeq for &'a mut Serializer {
311+
impl ser::SerializeSeq for &mut Serializer {
312312
// Must match the `Ok` type of the serializer.
313313
type Ok = ();
314314
// Must match the `Error` type of the serializer.
@@ -333,7 +333,7 @@ impl<'a> ser::SerializeSeq for &'a mut Serializer {
333333
}
334334

335335
// Same thing but for tuples.
336-
impl<'a> ser::SerializeTuple for &'a mut Serializer {
336+
impl ser::SerializeTuple for &mut Serializer {
337337
type Ok = ();
338338
type Error = Error;
339339

@@ -354,7 +354,7 @@ impl<'a> ser::SerializeTuple for &'a mut Serializer {
354354
}
355355

356356
// Same thing but for tuple structs.
357-
impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
357+
impl ser::SerializeTupleStruct for &mut Serializer {
358358
type Ok = ();
359359
type Error = Error;
360360

@@ -383,7 +383,7 @@ impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
383383
//
384384
// So the `end` method in this impl is responsible for closing both the `]` and
385385
// the `}`.
386-
impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
386+
impl ser::SerializeTupleVariant for &mut Serializer {
387387
type Ok = ();
388388
type Error = Error;
389389

@@ -411,7 +411,7 @@ impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
411411
// `serialize_entry` method allows serializers to optimize for the case where
412412
// key and value are both available simultaneously. In JSON it doesn't make a
413413
// difference so the default behavior for `serialize_entry` is fine.
414-
impl<'a> ser::SerializeMap for &'a mut Serializer {
414+
impl ser::SerializeMap for &mut Serializer {
415415
type Ok = ();
416416
type Error = Error;
417417

@@ -452,7 +452,7 @@ impl<'a> ser::SerializeMap for &'a mut Serializer {
452452

453453
// Structs are like maps in which the keys are constrained to be compile-time
454454
// constant strings.
455-
impl<'a> ser::SerializeStruct for &'a mut Serializer {
455+
impl ser::SerializeStruct for &mut Serializer {
456456
type Ok = ();
457457
type Error = Error;
458458

@@ -476,7 +476,7 @@ impl<'a> ser::SerializeStruct for &'a mut Serializer {
476476

477477
// Similar to `SerializeTupleVariant`, here the `end` method is responsible for
478478
// closing both of the curly braces opened by `serialize_struct_variant`.
479-
impl<'a> ser::SerializeStructVariant for &'a mut Serializer {
479+
impl ser::SerializeStructVariant for &mut Serializer {
480480
type Ok = ();
481481
type Error = Error;
482482

0 commit comments

Comments
 (0)