From 96e7c8de90af51da291b4e5eea034f2897b0ce44 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sun, 10 Sep 2023 22:08:15 +0000 Subject: [PATCH] fix: run clippy --- huff_parser/src/lib.rs | 6 +++--- huff_parser/tests/macro.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/huff_parser/src/lib.rs b/huff_parser/src/lib.rs index 22b122c5..c29fc5d1 100644 --- a/huff_parser/src/lib.rs +++ b/huff_parser/src/lib.rs @@ -104,7 +104,7 @@ impl Parser { TokenKind::Macro | TokenKind::Fn | TokenKind::Test => { let m = self.parse_macro()?; tracing::info!(target: "parser", "SUCCESSFULLY PARSED MACRO {}", m.name); - self.check_duplicate_macro(&mut contract, m.clone())?; + self.check_duplicate_macro(&contract, m.clone())?; contract.macros.push(m); } TokenKind::JumpTable | TokenKind::JumpTablePacked | TokenKind::CodeTable => { @@ -189,11 +189,11 @@ impl Parser { /// Checks if there is a duplicate macro name pub fn check_duplicate_macro( &self, - contract: &mut Contract, + contract: &Contract, m: MacroDefinition, ) -> Result<(), ParserError> { if contract.macros.binary_search_by(|_macro| _macro.name.cmp(&m.name)).is_ok() { - return Err(ParserError { + Err(ParserError { kind: ParserErrorKind::DuplicateMacro(m.name), hint: Some("MACRO names should be unique".to_string()), spans: AstSpan(vec![self.spans[2].clone()]), diff --git a/huff_parser/tests/macro.rs b/huff_parser/tests/macro.rs index 412d2136..6217eda2 100644 --- a/huff_parser/tests/macro.rs +++ b/huff_parser/tests/macro.rs @@ -1289,8 +1289,8 @@ fn test_duplicate_macro_error() { kind: ParserErrorKind::DuplicateMacro("MINT".to_string()), hint: Some("MACRO names should be unique".to_string()), spans: AstSpan(vec![Span { - start: occurrences[1].0.clone(), - end: occurrences[1].1.clone(), + start: occurrences[1].0, + end: occurrences[1].1, file: None }]), }