From 81587d7c95d0df0966693092dabd55b9dd1560e0 Mon Sep 17 00:00:00 2001 From: cakevm Date: Fri, 10 Jan 2025 19:51:09 +0100 Subject: [PATCH] Fix clippy --- crates/codegen/src/irgen/arg_calls.rs | 2 +- crates/core/tests/parser_errors.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/codegen/src/irgen/arg_calls.rs b/crates/codegen/src/irgen/arg_calls.rs index a556547..6142dbd 100644 --- a/crates/codegen/src/irgen/arg_calls.rs +++ b/crates/codegen/src/irgen/arg_calls.rs @@ -24,7 +24,7 @@ pub fn bubble_arg_call( if let Some(macro_invoc) = mis.last() { // Literal, Ident & Arg Call Check // First get this arg_nam position in the macro definition params - if let Some(pos) = macro_def.parameters.iter().position(|r| r.name.as_ref().map_or(false, |s| s.eq(arg_name))) { + if let Some(pos) = macro_def.parameters.iter().position(|r| r.name.as_ref().is_some_and(|s| s.eq(arg_name))) { tracing::info!(target: "codegen", "GOT \"{}\" POS IN ARG LIST: {}", arg_name, pos); if let Some(arg) = macro_invoc.1.args.get(pos) { diff --git a/crates/core/tests/parser_errors.rs b/crates/core/tests/parser_errors.rs index b4e34f0..807423c 100644 --- a/crates/core/tests/parser_errors.rs +++ b/crates/core/tests/parser_errors.rs @@ -248,7 +248,7 @@ fn test_invalid_token_in_label_definition() { fn test_invalid_single_arg() { for _ in 0..10_000 { let random_char = rand::random::() as char; - if random_char.is_numeric() || !random_char.is_alphabetic() || random_char.to_string().as_bytes().len() > 1 { + if random_char.is_numeric() || !random_char.is_alphabetic() || random_char.to_string().len() > 1 { continue; } let source = &format!("#define macro CONSTANT() = takes ({random_char}) returns (0) {{}}");