From 7a2d9f61d0fbe1dd5988946248fe59c43b475cfd Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 29 Nov 2024 11:17:46 +0800 Subject: [PATCH] fix --- 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 6c77251..b280040 100644 --- a/src/diagnostic_chain.rs +++ b/src/diagnostic_chain.rs @@ -70,7 +70,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), @@ -79,7 +79,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 bb1788a..fd7d9d3 100644 --- a/src/eyreish/ptr.rs +++ b/src/eyreish/ptr.rs @@ -59,9 +59,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, { @@ -110,9 +110,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, { @@ -142,7 +142,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 911e315..bb6039d 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 40b2feb..5e4ba09 100644 --- a/src/source_impls.rs +++ b/src/source_impls.rs @@ -100,7 +100,7 @@ impl SourceCode for [u8] { } } -impl<'src> SourceCode for &'src [u8] { +impl SourceCode for &[u8] { fn read_span<'a>( &'a self, span: &SourceSpan, @@ -139,7 +139,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,