]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/http2: fix clippy lint for is_empty()
authorJason Ish <jason.ish@oisf.net>
Fri, 2 Dec 2022 14:31:58 +0000 (08:31 -0600)
committerVictor Julien <vjulien@oisf.net>
Sat, 3 Dec 2022 05:37:48 +0000 (06:37 +0100)
This snuck through as "cargo clippy" check wasn't finding lints that
were fixed by the previous test for fixable lints.

rust/src/http2/http2.rs

index 3a6ffab7ec369d811b824bc55cdfdbc054fc926d..ed57ebdda805a382931c5e9ae33d41463c955fc3 100644 (file)
@@ -958,7 +958,7 @@ impl HTTP2State {
                                         tx_same.ft_ts.tx_id = tx_same.tx_id - 1;
                                     };
                                     let mut dinput = &rem[..hlsafe];
-                                    if padded && rem.len() > 0 && usize::from(rem[0]) < hlsafe{
+                                    if padded && !rem.is_empty() && usize::from(rem[0]) < hlsafe{
                                         dinput = &rem[1..hlsafe - usize::from(rem[0])];
                                     }
                                     match tx_same.decompress(