Skip to content

Commit

Permalink
chore(clippy): make clippy happy (#4334)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Feb 11, 2023
1 parent b5784e9 commit 60f36a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/src/parser/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -106,7 +106,7 @@ pub struct Comments(Vec<Comment>);
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),*)
}
};
Expand Down
5 changes: 2 additions & 3 deletions doc/src/parser/item.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::{error::ParserResult, Comments};
use forge_fmt::{
solang_ext::SafeUnwrap, Comments as FmtComments, Formatter, FormatterConfig, InlineConfig,
Visitor,
Expand All @@ -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 {
Expand All @@ -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<Vec<(&'a $ret, &'a Comments, &'a String)>> {
$vis fn $name(&self) -> Option<Vec<(&$ret, &Comments, &String)>> {
let items = self.children.iter().filter_map(|item| match item.source {
ParseSource::$variant(ref inner) => Some((inner, &item.comments, &item.code)),
_ => None,
Expand Down

0 comments on commit 60f36a6

Please sign in to comment.