From 8c2f68a221347fc2eab7f8f13a6a6f55ee339347 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 31 Oct 2023 22:35:26 +0900 Subject: [PATCH] Remove as casts --- src/cfg_expr/expr/parser.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cfg_expr/expr/parser.rs b/src/cfg_expr/expr/parser.rs index ea0c98a..23f54e2 100644 --- a/src/cfg_expr/expr/parser.rs +++ b/src/cfg_expr/expr/parser.rs @@ -140,11 +140,9 @@ impl Expression { let key = pred_key.take(); let val = pred_val.take(); - // In this context, the boolean to int conversion is confusing. - #[allow(clippy::bool_to_int_with_if)] let num_predicates = top.predicates.len() - + if key.is_some() { 1 } else { 0 } - + top.nest_level as usize; + + usize::from(key.is_some()) + + usize::from(top.nest_level); let func = match top.func { Func::All(_) => Func::All(num_predicates),