Skip to content

Commit

Permalink
Remove a few unnecessary lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimo414 committed Oct 6, 2023
1 parent 57d529b commit 9d86391
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/value/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl From<String> for Value {
}
}

impl<'a> From<&'a str> for Value {
impl From<&str> for Value {
/// Convert string slice to `Value`
///
/// # Examples
Expand Down Expand Up @@ -181,7 +181,7 @@ impl<T: Into<Value>> From<Vec<T>> for Value {
}
}

impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value {
impl<T: Clone + Into<Value>> From<&[T]> for Value {
/// Convert a slice to `Value`
///
/// # Examples
Expand All @@ -192,7 +192,7 @@ impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value {
/// let v: &[&str] = &["lorem", "ipsum", "dolor"];
/// let x: Value = v.into();
/// ```
fn from(f: &'a [T]) -> Self {
fn from(f: &[T]) -> Self {
Value::Array(f.iter().cloned().map(Into::into).collect())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/value/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl Index for String {
}
}

impl<'a, T> Index for &'a T
impl<T> Index for &T
where
T: ?Sized + Index,
{
Expand Down
4 changes: 2 additions & 2 deletions src/value/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl PartialEq<str> for Value {
}
}

impl<'a> PartialEq<&'a str> for Value {
impl PartialEq<&str> for Value {
fn eq(&self, other: &&str) -> bool {
eq_str(self, *other)
}
Expand All @@ -46,7 +46,7 @@ impl PartialEq<Value> for str {
}
}

impl<'a> PartialEq<Value> for &'a str {
impl PartialEq<Value> for &str {
fn eq(&self, other: &Value) -> bool {
eq_str(other, *self)
}
Expand Down

0 comments on commit 9d86391

Please sign in to comment.