From b267a00ed39b8581f05d272061b4bf1977fd2137 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Sat, 30 Nov 2024 10:39:14 +0100 Subject: [PATCH] refactor: fix new clippy lifetime elision warnings --- src/parser/components.rs | 6 ++++-- src/parser/parameters.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/parser/components.rs b/src/parser/components.rs index ec989ff..292841f 100644 --- a/src/parser/components.rs +++ b/src/parser/components.rs @@ -41,8 +41,8 @@ pub struct Component<'a> { pub components: Vec>, } +#[cfg(test)] impl<'a> Component<'a> { - #[cfg(test)] pub(crate) fn new_empty(name: &'a str) -> Component<'a> { Component { name: name.into(), @@ -50,7 +50,9 @@ impl<'a> Component<'a> { components: Default::default(), } } +} +impl Component<'_> { pub fn find_prop>(&self, name: S) -> Option<&Property> { self.properties .iter() @@ -155,7 +157,7 @@ impl From> for InnerComponent { } impl<'a> From> for CalendarComponent { - fn from(component: Component<'_>) -> CalendarComponent { + fn from(component: Component<'a>) -> CalendarComponent { use crate::{Event, Todo, Venue}; match component.name.as_ref() { "VEVENT" => Event::from(InnerComponent::from(component)).into(), diff --git a/src/parser/parameters.rs b/src/parser/parameters.rs index 9df9c46..efe1f45 100644 --- a/src/parser/parameters.rs +++ b/src/parser/parameters.rs @@ -42,7 +42,7 @@ impl<'a> TryFrom<&'a str> for Parameter<'a> { } } -impl<'a> From> for crate::properties::Parameter { +impl From> for crate::properties::Parameter { fn from(parameter: Parameter<'_>) -> crate::properties::Parameter { crate::properties::Parameter::new( parameter.key.as_ref(),