From 60f36a64012e5180cec7c7c0c660943370c8d684 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 11 Feb 2023 11:44:17 +0100 Subject: [PATCH] chore(clippy): make clippy happy (#4334) --- doc/src/parser/comment.rs | 4 ++-- doc/src/parser/item.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/src/parser/comment.rs b/doc/src/parser/comment.rs index 5f7c160841ff..a897804496be 100644 --- a/doc/src/parser/comment.rs +++ b/doc/src/parser/comment.rs @@ -84,7 +84,7 @@ impl Comment { /// Match the first word of the comment with the expected. /// Returns [None] if the word doesn't match. /// Useful for [CommentTag::Param] and [CommentTag::Return] comments. - pub fn match_first_word<'a>(&'a self, expected: &str) -> Option<&'a str> { + pub fn match_first_word(&self, expected: &str) -> Option<&str> { self.split_first_word().and_then( |(word, rest)| { if word.eq(expected) { @@ -106,7 +106,7 @@ pub struct Comments(Vec); macro_rules! ref_fn { ($vis:vis fn $name:ident(&self$(, )?$($arg_name:ident: $arg:ty),*) -> $ret:ty) => { /// Forward the function implementation to [CommentsRef] reference type. - $vis fn $name<'a>(&'a self, $($arg_name: $arg),*) -> $ret { + $vis fn $name(&self, $($arg_name: $arg),*) -> $ret { CommentsRef::from(self).$name($($arg_name),*) } }; diff --git a/doc/src/parser/item.rs b/doc/src/parser/item.rs index b4db1f9ec31f..d07e530c2ef5 100644 --- a/doc/src/parser/item.rs +++ b/doc/src/parser/item.rs @@ -1,3 +1,4 @@ +use crate::{error::ParserResult, Comments}; use forge_fmt::{ solang_ext::SafeUnwrap, Comments as FmtComments, Formatter, FormatterConfig, InlineConfig, Visitor, @@ -7,8 +8,6 @@ use solang_parser::pt::{ StructDefinition, TypeDefinition, VariableDefinition, }; -use crate::{error::ParserResult, Comments}; - /// The parsed item. #[derive(PartialEq, Debug)] pub struct ParseItem { @@ -28,7 +27,7 @@ pub struct ParseItem { macro_rules! filter_children_fn { ($vis:vis fn $name:ident(&self, $variant:ident) -> $ret:ty) => { /// Filter children items for [ParseSource::$variant] variants. - $vis fn $name<'a>(&'a self) -> Option> { + $vis fn $name(&self) -> Option> { let items = self.children.iter().filter_map(|item| match item.source { ParseSource::$variant(ref inner) => Some((inner, &item.comments, &item.code)), _ => None,