Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a few unnecessary lifetimes #1075

Merged
merged 1 commit into from Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/value/from.rs
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
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
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