From: Jason Ish Date: Mon, 3 Oct 2022 21:42:20 +0000 (-0600) Subject: rust: fix clippy lint for bool_assert_comparison X-Git-Tag: suricata-7.0.0-beta1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3e4bcfe230bc1378e6a67e2b64976f82c752610;p=thirdparty%2Fsuricata.git rust: fix clippy lint for bool_assert_comparison Checking for is_empty is faster than checking for equality. --- 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()