From f3e4bcfe230bc1378e6a67e2b64976f82c752610 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 3 Oct 2022 15:42:20 -0600 Subject: [PATCH] rust: fix clippy lint for bool_assert_comparison Checking for is_empty is faster than checking for equality. --- rust/src/detect/byte_math.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/detect/byte_math.rs b/rust/src/detect/byte_math.rs index 98e3def601..3922c1eb94 100644 --- a/rust/src/detect/byte_math.rs +++ b/rust/src/detect/byte_math.rs @@ -469,7 +469,7 @@ mod tests { nbytes: nbytes, offset: offset, oper: oper, - rvalue_str: if rvalue_str != "" { + rvalue_str: if !rvalue_str.is_empty() { CString::new(rvalue_str).unwrap().into_raw() } else { std::ptr::null_mut()