From 5e4c2bc4f23c1235d7c05b3944244218156056ce Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 14 Jun 2024 21:02:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20(parser):=20Fix=20compiler=20war?= =?UTF-8?q?nings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit semver: chore --- src/files.rs | 2 +- src/parser/expression.rs | 2 +- src/parser/macros.rs | 15 +++++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/files.rs b/src/files.rs index 0debc43..625d5eb 100644 --- a/src/files.rs +++ b/src/files.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, ops::Index}; +use std::collections::HashMap; #[derive(Default)] pub struct Files<'a> { diff --git a/src/parser/expression.rs b/src/parser/expression.rs index dab507f..714853f 100644 --- a/src/parser/expression.rs +++ b/src/parser/expression.rs @@ -2,7 +2,7 @@ use super::{ ast::{Expression, UnaryOperation}, lookup::BindingPower, macros::{expect_expression, expect_token_value, expect_tokens, expect_valid_token}, - Diagnostic, Parser, + Parser, }; use crate::{ diagnostic::Error, diff --git a/src/parser/macros.rs b/src/parser/macros.rs index e4dab99..ea19ef6 100644 --- a/src/parser/macros.rs +++ b/src/parser/macros.rs @@ -110,16 +110,11 @@ macro_rules! expect_tokens { let lexeme: Option<&crate::scanner::lexeme::Lexeme> = $parser.lexemes.get(i); match lexeme { - Some(lexeme) => { - match lexeme { - crate::scanner::lexeme::Lexeme::Valid(token) => { - if token.token_type == $token_type { - tokens.push(token.clone()); - valid += 1; - } - } - _ => {} - }; + Some(crate::scanner::lexeme::Lexeme::Valid(token)) => { + if token.token_type == $token_type { + tokens.push(token.clone()); + valid += 1; + } } _ => {} };