From 7a533704bb042a01def1b73a77a672395c6cc462 Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Thu, 9 Nov 2023 23:33:06 +0100 Subject: [PATCH] chore: fix clippy warnings --- boreal-parser/src/expression/for_expression.rs | 2 +- boreal-parser/src/file.rs | 2 +- boreal-parser/src/nom_recipes.rs | 2 +- boreal/src/module/pe/debug.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boreal-parser/src/expression/for_expression.rs b/boreal-parser/src/expression/for_expression.rs index 37b411fd..3ad29357 100644 --- a/boreal-parser/src/expression/for_expression.rs +++ b/boreal-parser/src/expression/for_expression.rs @@ -150,7 +150,7 @@ fn for_expression_kind(input: Input) -> ParseResult { preceded(rtrim(ttag("at")), cut(primary_expression)), |expr| ForExprKind::At(Box::new(expr)), ), - map(success(()), |_| ForExprKind::None), + map(success(()), |()| ForExprKind::None), ))(input) } diff --git a/boreal-parser/src/file.rs b/boreal-parser/src/file.rs index 0a5c82dd..d8218ce6 100644 --- a/boreal-parser/src/file.rs +++ b/boreal-parser/src/file.rs @@ -64,7 +64,7 @@ pub struct Include { /// If the input cannot be parsed properly and entirely as a list /// of yara rules, an error is returned. pub(crate) fn parse_yara_file(input: Input) -> ParseResult { - let (mut input, _) = ltrim(input)?; + let (mut input, ()) = ltrim(input)?; let mut file = YaraFile { components: Vec::new(), diff --git a/boreal-parser/src/nom_recipes.rs b/boreal-parser/src/nom_recipes.rs index 2643a8c5..c88b5635 100644 --- a/boreal-parser/src/nom_recipes.rs +++ b/boreal-parser/src/nom_recipes.rs @@ -41,7 +41,7 @@ pub(crate) fn ltrim(mut input: Input) -> ParseResult<()> { value((), multispace1), ))(input) { - Ok((i, _)) => input = i, + Ok((i, ())) => input = i, Err(nom::Err::Error(_)) => return Ok((input, ())), err @ Err(_) => return err, } diff --git a/boreal/src/module/pe/debug.rs b/boreal/src/module/pe/debug.rs index f487afc4..0b2a07bc 100644 --- a/boreal/src/module/pe/debug.rs +++ b/boreal/src/module/pe/debug.rs @@ -41,7 +41,7 @@ pub fn pdb_path(data_dirs: &DataDirectories, mem: &[u8], sections: &SectionTable let mut info = Bytes(info); let sig = match info.read_bytes(4) { Ok(v) => v.0, - Err(_) => continue, + Err(()) => continue, }; let pdb_path_offset = match sig {