fix(clippy): elide lifetimes

This commit is contained in:
Gabriel Levcovitz 2025-02-17 17:30:05 -03:00
parent b8c144f2a6
commit 18e88756c6
No known key found for this signature in database
4 changed files with 10 additions and 10 deletions

View File

@ -74,7 +74,7 @@ impl<'a> ErrorKind<'a> {
} }
} }
impl<'a> std::fmt::Debug for ErrorKind<'a> { impl std::fmt::Debug for ErrorKind<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
ErrorKind::Diagnostic(d) => d.fmt(f), ErrorKind::Diagnostic(d) => d.fmt(f),
@ -83,7 +83,7 @@ impl<'a> std::fmt::Debug for ErrorKind<'a> {
} }
} }
impl<'a> std::fmt::Display for ErrorKind<'a> { impl std::fmt::Display for ErrorKind<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
ErrorKind::Diagnostic(d) => d.fmt(f), ErrorKind::Diagnostic(d) => d.fmt(f),

View File

@ -69,9 +69,9 @@ where
lifetime: PhantomData<&'a T>, lifetime: PhantomData<&'a T>,
} }
impl<'a, T> Copy for Ref<'a, T> where T: ?Sized {} impl<T> Copy for Ref<'_, T> where T: ?Sized {}
impl<'a, T> Clone for Ref<'a, T> impl<T> Clone for Ref<'_, T>
where where
T: ?Sized, T: ?Sized,
{ {
@ -132,9 +132,9 @@ where
lifetime: PhantomData<&'a mut T>, lifetime: PhantomData<&'a mut T>,
} }
impl<'a, T> Copy for Mut<'a, T> where T: ?Sized {} impl<T> Copy for Mut<'_, T> where T: ?Sized {}
impl<'a, T> Clone for Mut<'a, T> impl<T> Clone for Mut<'_, T>
where where
T: ?Sized, T: ?Sized,
{ {
@ -173,7 +173,7 @@ where
} }
} }
impl<'a, T> Mut<'a, T> { impl<T> Mut<'_, T> {
pub(crate) unsafe fn read(self) -> T { pub(crate) unsafe fn read(self) -> T {
self.ptr.as_ptr().read() self.ptr.as_ptr().read()
} }

View File

@ -134,7 +134,7 @@ impl From<&str> for Box<dyn Diagnostic> {
} }
} }
impl<'a> From<&str> for Box<dyn Diagnostic + Send + Sync + 'a> { impl From<&str> for Box<dyn Diagnostic + Send + Sync + '_> {
fn from(s: &str) -> Self { fn from(s: &str) -> Self {
From::from(String::from(s)) From::from(String::from(s))
} }

View File

@ -104,7 +104,7 @@ impl SourceCode for [u8] {
} }
} }
impl<'src> SourceCode for &'src [u8] { impl SourceCode for &[u8] {
fn read_span<'a>( fn read_span<'a>(
&'a self, &'a self,
span: &SourceSpan, span: &SourceSpan,
@ -143,7 +143,7 @@ impl SourceCode for str {
} }
/// Makes `src: &'static str` or `struct S<'a> { src: &'a str }` usable. /// Makes `src: &'static str` or `struct S<'a> { src: &'a str }` usable.
impl<'s> SourceCode for &'s str { impl SourceCode for &str {
fn read_span<'a>( fn read_span<'a>(
&'a self, &'a self,
span: &SourceSpan, span: &SourceSpan,