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(),