Elide useless lifetimes

This commit is contained in:
Dirkjan Ochtman 2024-11-14 11:44:22 +01:00
parent 4030539da8
commit 74be76d427
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ pub fn display_to_xml(
struct DisplayToXml<'a, T: fmt::Display>(pub &'a T); struct DisplayToXml<'a, T: fmt::Display>(pub &'a T);
impl<'a, T> ToXml for DisplayToXml<'a, T> impl<T> ToXml for DisplayToXml<'_, T>
where where
T: fmt::Display, T: fmt::Display,
{ {
@ -318,7 +318,7 @@ pub struct CowStrAccumulator<'xml, 'a> {
marker: PhantomData<&'xml str>, marker: PhantomData<&'xml str>,
} }
impl<'xml, 'a> Accumulate<Cow<'a, str>> for CowStrAccumulator<'xml, 'a> { impl<'a> Accumulate<Cow<'a, str>> for CowStrAccumulator<'_, 'a> {
fn try_done(self, field: &'static str) -> Result<Cow<'a, str>, Error> { fn try_done(self, field: &'static str) -> Result<Cow<'a, str>, Error> {
match self.inner { match self.inner {
Some(inner) => Ok(inner), Some(inner) => Ok(inner),
@ -330,7 +330,7 @@ impl<'xml, 'a> Accumulate<Cow<'a, str>> for CowStrAccumulator<'xml, 'a> {
// The `FromXml` implementation for `Cow<'a, [T]>` always builds a `Cow::Owned`: // 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 // 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). // 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 where
[T]: ToOwned<Owned = Vec<T>>, [T]: ToOwned<Owned = Vec<T>>,
{ {

View File

@ -26,7 +26,7 @@ pub trait ToXml {
} }
} }
impl<'a, T: ToXml + ?Sized> ToXml for &'a T { impl<T: ToXml + ?Sized> ToXml for &T {
fn serialize<W: fmt::Write + ?Sized>( fn serialize<W: fmt::Write + ?Sized>(
&self, &self,
field: Option<Id<'_>>, field: Option<Id<'_>>,