Skip to content

Commit

Permalink
refactor: fix new clippy lifetime elision warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Nov 30, 2024
1 parent 5c16023 commit b267a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/parser/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ pub struct Component<'a> {
pub components: Vec<Component<'a>>,
}

#[cfg(test)]
impl<'a> Component<'a> {
#[cfg(test)]
pub(crate) fn new_empty(name: &'a str) -> Component<'a> {
Component {
name: name.into(),
properties: Default::default(),
components: Default::default(),
}
}
}

impl Component<'_> {
pub fn find_prop<S: AsRef<str>>(&self, name: S) -> Option<&Property> {
self.properties
.iter()
Expand Down Expand Up @@ -155,7 +157,7 @@ impl From<Component<'_>> for InnerComponent {
}

impl<'a> From<Component<'a>> 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(),
Expand Down
2 changes: 1 addition & 1 deletion src/parser/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<'a> TryFrom<&'a str> for Parameter<'a> {
}
}

impl<'a> From<Parameter<'a>> for crate::properties::Parameter {
impl From<Parameter<'_>> for crate::properties::Parameter {
fn from(parameter: Parameter<'_>) -> crate::properties::Parameter {
crate::properties::Parameter::new(
parameter.key.as_ref(),
Expand Down

0 comments on commit b267a00

Please sign in to comment.