Skip to content

Commit 78dae9d

Browse files
committed
style: add missing lifetimes
Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
1 parent 72153e7 commit 78dae9d

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/object.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ impl Object {
501501
}
502502

503503
#[inline(always)]
504-
pub fn iter(&self) -> Iter {
504+
pub fn iter(&self) -> Iter<'_> {
505505
Iter {
506506
inner: self.store.iter(),
507507
}
508508
}
509509

510510
#[inline(always)]
511-
pub fn iter_mut(&mut self) -> IterMut {
511+
pub fn iter_mut(&mut self) -> IterMut<'_> {
512512
IterMut {
513513
inner: self.store.iter_mut(),
514514
}
@@ -718,7 +718,7 @@ impl IntoIterator for Object {
718718
/// # }
719719
/// ```
720720
// TODO: doc
721-
impl<'a> Index<&'a str> for Object {
721+
impl Index<&str> for Object {
722722
type Output = JsonValue;
723723

724724
fn index(&self, index: &str) -> &JsonValue {
@@ -737,7 +737,7 @@ impl Index<String> for Object {
737737
}
738738
}
739739

740-
impl<'a> Index<&'a String> for Object {
740+
impl Index<&String> for Object {
741741
type Output = JsonValue;
742742

743743
fn index(&self, index: &String) -> &JsonValue {
@@ -764,7 +764,7 @@ impl<'a> Index<&'a String> for Object {
764764
/// }
765765
/// # }
766766
/// ```
767-
impl<'a> IndexMut<&'a str> for Object {
767+
impl IndexMut<&str> for Object {
768768
fn index_mut(&mut self, index: &str) -> &mut JsonValue {
769769
if self.get(index).is_none() {
770770
self.insert(index, JsonValue::Null);
@@ -779,7 +779,7 @@ impl IndexMut<String> for Object {
779779
}
780780
}
781781

782-
impl<'a> IndexMut<&'a String> for Object {
782+
impl IndexMut<&String> for Object {
783783
fn index_mut(&mut self, index: &String) -> &mut JsonValue {
784784
self.index_mut(index.deref())
785785
}

src/value/implements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<K: AsRef<str>, V: Into<JsonValue>> From<BTreeMap<K, V>> for JsonValue {
103103
}
104104
}
105105

106-
impl<'a> PartialEq<&'a str> for JsonValue {
106+
impl PartialEq<&str> for JsonValue {
107107
fn eq(&self, other: &&str) -> bool {
108108
match *self {
109109
JsonValue::Short(ref value) => value == *other,
@@ -113,7 +113,7 @@ impl<'a> PartialEq<&'a str> for JsonValue {
113113
}
114114
}
115115

116-
impl<'a> PartialEq<JsonValue> for &'a str {
116+
impl PartialEq<JsonValue> for &str {
117117
fn eq(&self, other: &JsonValue) -> bool {
118118
match *other {
119119
JsonValue::Short(ref value) => value == *self,

src/value/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl JsonValue {
490490
/// }
491491
/// assert_eq!(animals_with_letter_a, vec!["Cat", "Snail"]);
492492
/// ```
493-
pub fn members(&self) -> Members {
493+
pub fn members(&self) -> Members<'_> {
494494
match *self {
495495
JsonValue::Array(ref vec) => vec.iter(),
496496
_ => [].iter(),
@@ -499,7 +499,7 @@ impl JsonValue {
499499

500500
/// Works on `JsonValue::Array` - returns a mutable iterator over members.
501501
/// Will return an empty iterator if called on non-array types.
502-
pub fn members_mut(&mut self) -> MembersMut {
502+
pub fn members_mut(&mut self) -> MembersMut<'_> {
503503
match *self {
504504
JsonValue::Array(ref mut vec) => vec.iter_mut(),
505505
_ => [].iter_mut(),
@@ -529,7 +529,7 @@ impl JsonValue {
529529
/// assert_eq!(total_height, 5.12);
530530
/// assert_eq!(names_with_o, vec!["Bob", "Carlos"]);
531531
/// ```
532-
pub fn entries(&self) -> Entries {
532+
pub fn entries(&self) -> Entries<'_> {
533533
match *self {
534534
JsonValue::Object(ref object) => object.iter(),
535535
_ => Entries::empty(),
@@ -539,7 +539,7 @@ impl JsonValue {
539539
/// Works on `JsonValue::Object` - returns a mutable iterator over
540540
/// key value pairs.
541541
/// Will return an empty iterator if called on non-object types.
542-
pub fn entries_mut(&mut self) -> EntriesMut {
542+
pub fn entries_mut(&mut self) -> EntriesMut<'_> {
543543
match *self {
544544
JsonValue::Object(ref mut object) => object.iter_mut(),
545545
_ => EntriesMut::empty(),
@@ -694,7 +694,7 @@ impl IndexMut<usize> for JsonValue {
694694
/// assert!(object["foo"] == "bar");
695695
/// # }
696696
/// ```
697-
impl<'a> Index<&'a str> for JsonValue {
697+
impl Index<&str> for JsonValue {
698698
type Output = JsonValue;
699699

700700
fn index(&self, index: &str) -> &JsonValue {
@@ -713,7 +713,7 @@ impl Index<String> for JsonValue {
713713
}
714714
}
715715

716-
impl<'a> Index<&'a String> for JsonValue {
716+
impl Index<&String> for JsonValue {
717717
type Output = JsonValue;
718718

719719
fn index(&self, index: &String) -> &JsonValue {
@@ -737,7 +737,7 @@ impl<'a> Index<&'a String> for JsonValue {
737737
/// assert!(object["foo"] == 42);
738738
/// # }
739739
/// ```
740-
impl<'a> IndexMut<&'a str> for JsonValue {
740+
impl IndexMut<&str> for JsonValue {
741741
fn index_mut(&mut self, index: &str) -> &mut JsonValue {
742742
match *self {
743743
JsonValue::Object(ref mut object) => &mut object[index],
@@ -755,7 +755,7 @@ impl IndexMut<String> for JsonValue {
755755
}
756756
}
757757

758-
impl<'a> IndexMut<&'a String> for JsonValue {
758+
impl IndexMut<&String> for JsonValue {
759759
fn index_mut(&mut self, index: &String) -> &mut JsonValue {
760760
self.index_mut(index.deref())
761761
}

0 commit comments

Comments
 (0)