mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(span): remove unnecessary lifetimes on Atom impls (#8639)
Pure refactor. The lifetime of the `Atom` is not relevant in these trait impls. Remove the lifetimes to make that clearer.
This commit is contained in:
parent
61d96fde64
commit
20f52b1fee
1 changed files with 10 additions and 10 deletions
|
|
@ -119,16 +119,16 @@ impl<'a> From<Atom<'a>> for &'a str {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<Atom<'a>> for CompactStr {
|
||||
impl From<Atom<'_>> for CompactStr {
|
||||
#[inline]
|
||||
fn from(val: Atom<'a>) -> Self {
|
||||
fn from(val: Atom<'_>) -> Self {
|
||||
val.into_compact_str()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<Atom<'a>> for String {
|
||||
impl From<Atom<'_>> for String {
|
||||
#[inline]
|
||||
fn from(val: Atom<'a>) -> Self {
|
||||
fn from(val: Atom<'_>) -> Self {
|
||||
val.into_string()
|
||||
}
|
||||
}
|
||||
|
|
@ -166,8 +166,8 @@ impl<T: AsRef<str>> PartialEq<T> for Atom<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<Atom<'a>> for &str {
|
||||
fn eq(&self, other: &Atom<'a>) -> bool {
|
||||
impl PartialEq<Atom<'_>> for &str {
|
||||
fn eq(&self, other: &Atom<'_>) -> bool {
|
||||
*self == other.as_str()
|
||||
}
|
||||
}
|
||||
|
|
@ -178,14 +178,14 @@ impl PartialEq<str> for Atom<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<Atom<'a>> for Cow<'_, str> {
|
||||
fn eq(&self, other: &Atom<'a>) -> bool {
|
||||
impl PartialEq<Atom<'_>> for Cow<'_, str> {
|
||||
fn eq(&self, other: &Atom<'_>) -> bool {
|
||||
self.as_ref() == other.as_str()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<&Atom<'a>> for Cow<'_, str> {
|
||||
fn eq(&self, other: &&Atom<'a>) -> bool {
|
||||
impl PartialEq<&Atom<'_>> for Cow<'_, str> {
|
||||
fn eq(&self, other: &&Atom<'_>) -> bool {
|
||||
self.as_ref() == other.as_str()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue