From 18e88756c60e31862d390c5cf1a49dd5dc89bfe0 Mon Sep 17 00:00:00 2001 From: Gabriel Levcovitz Date: Mon, 17 Feb 2025 17:30:05 -0300 Subject: [PATCH] fix(clippy): elide lifetimes --- src/diagnostic_chain.rs | 4 ++-- src/eyreish/ptr.rs | 10 +++++----- src/protocol.rs | 2 +- src/source_impls.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/diagnostic_chain.rs b/src/diagnostic_chain.rs index 1e5e0c2..996fdba 100644 --- a/src/diagnostic_chain.rs +++ b/src/diagnostic_chain.rs @@ -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 { match self { 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 { match self { ErrorKind::Diagnostic(d) => d.fmt(f), diff --git a/src/eyreish/ptr.rs b/src/eyreish/ptr.rs index fa954d1..40c9c7b 100644 --- a/src/eyreish/ptr.rs +++ b/src/eyreish/ptr.rs @@ -69,9 +69,9 @@ where lifetime: PhantomData<&'a T>, } -impl<'a, T> Copy for Ref<'a, T> where T: ?Sized {} +impl Copy for Ref<'_, T> where T: ?Sized {} -impl<'a, T> Clone for Ref<'a, T> +impl Clone for Ref<'_, T> where T: ?Sized, { @@ -132,9 +132,9 @@ where lifetime: PhantomData<&'a mut T>, } -impl<'a, T> Copy for Mut<'a, T> where T: ?Sized {} +impl Copy for Mut<'_, T> where T: ?Sized {} -impl<'a, T> Clone for Mut<'a, T> +impl Clone for Mut<'_, T> where T: ?Sized, { @@ -173,7 +173,7 @@ where } } -impl<'a, T> Mut<'a, T> { +impl Mut<'_, T> { pub(crate) unsafe fn read(self) -> T { self.ptr.as_ptr().read() } diff --git a/src/protocol.rs b/src/protocol.rs index 7f09d4d..c2df294 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -134,7 +134,7 @@ impl From<&str> for Box { } } -impl<'a> From<&str> for Box { +impl From<&str> for Box { fn from(s: &str) -> Self { From::from(String::from(s)) } diff --git a/src/source_impls.rs b/src/source_impls.rs index e362b4a..9c26b71 100644 --- a/src/source_impls.rs +++ b/src/source_impls.rs @@ -104,7 +104,7 @@ impl SourceCode for [u8] { } } -impl<'src> SourceCode for &'src [u8] { +impl SourceCode for &[u8] { fn read_span<'a>( &'a self, span: &SourceSpan, @@ -143,7 +143,7 @@ impl SourceCode for str { } /// 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>( &'a self, span: &SourceSpan,