]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lint for bool_assert_comparison
authorJason Ish <jason.ish@oisf.net>
Mon, 3 Oct 2022 21:42:20 +0000 (15:42 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 4 Oct 2022 09:22:02 +0000 (11:22 +0200)
Checking for is_empty is faster than checking for equality.

rust/src/detect/byte_math.rs

index 98e3def601eb1235bd867b7ce520ee8b0b5f9cbb..3922c1eb94b03f78242f600fe6dea09a32308149 100644 (file)
@@ -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()