From 74be76d4273c0db27eaf43159dcd1ab300b7e965 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 14 Nov 2024 11:44:22 +0100 Subject: [PATCH] Elide useless lifetimes --- instant-xml/src/impls.rs | 6 +++--- instant-xml/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instant-xml/src/impls.rs b/instant-xml/src/impls.rs index 7683a22..dcb0598 100644 --- a/instant-xml/src/impls.rs +++ b/instant-xml/src/impls.rs @@ -132,7 +132,7 @@ pub fn display_to_xml( struct DisplayToXml<'a, T: fmt::Display>(pub &'a T); -impl<'a, T> ToXml for DisplayToXml<'a, T> +impl ToXml for DisplayToXml<'_, T> where T: fmt::Display, { @@ -318,7 +318,7 @@ pub struct CowStrAccumulator<'xml, 'a> { marker: PhantomData<&'xml str>, } -impl<'xml, 'a> Accumulate> for CowStrAccumulator<'xml, 'a> { +impl<'a> Accumulate> for CowStrAccumulator<'_, 'a> { fn try_done(self, field: &'static str) -> Result, Error> { match self.inner { Some(inner) => Ok(inner), @@ -330,7 +330,7 @@ impl<'xml, 'a> Accumulate> for CowStrAccumulator<'xml, 'a> { // The `FromXml` implementation for `Cow<'a, [T]>` always builds a `Cow::Owned`: // it is not possible to deserialize into a `Cow::Borrowed` because there's no // place to store the originating slice (length only known at run-time). -impl<'xml, 'a, T: FromXml<'xml>> FromXml<'xml> for Cow<'a, [T]> +impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Cow<'_, [T]> where [T]: ToOwned>, { diff --git a/instant-xml/src/lib.rs b/instant-xml/src/lib.rs index e31685a..00e5838 100644 --- a/instant-xml/src/lib.rs +++ b/instant-xml/src/lib.rs @@ -26,7 +26,7 @@ pub trait ToXml { } } -impl<'a, T: ToXml + ?Sized> ToXml for &'a T { +impl ToXml for &T { fn serialize( &self, field: Option>,