]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lints for clippy::nonminimal_bool
authorJason Ish <jason.ish@oisf.net>
Wed, 5 Oct 2022 15:05:12 +0000 (09:05 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 09:20:09 +0000 (11:20 +0200)
rust/src/quic/quic.rs
rust/src/rdp/parser.rs

index 846b493199446fcd5321f743d6bf1ed68a44a475..4df69984ed497b452ffcde18c4258bf4613ffb31 100644 (file)
@@ -180,7 +180,7 @@ impl QuicState {
                 &mut h20,
                 &mut pktnum_buf,
             );
-            if !r1.is_ok() {
+            if r1.is_err() {
                 return Err(());
             }
             // mutate one at a time
index f0b89da0c84a1f3e02652f0e5a005866f8b9fe2e..590ef6ff5b546dca9a12c0d7c967f4b74879c812 100644 (file)
@@ -501,7 +501,7 @@ fn parse_x224_connection_request(input: &[u8]) -> IResult<&[u8], X224ConnectionR
     let (i4, src_ref) = be_u16(i3)?;
     let (i5, class_options) = parse_class_options(i4).map_err(Err::convert)?;
     // less cr_cdt (u8), dst_ref (u16), src_ref (u16), class_options (u8)
-    if !(length >= 6) {
+    if length < 6 {
         return Err(Err::Error(make_error(i1, ErrorKind::Verify)));
     }
     let i6 = i5;
@@ -606,7 +606,7 @@ fn parse_x224_connection_confirm(input: &[u8]) -> IResult<&[u8], X224ConnectionC
     let (i5, class_options) = parse_class_options(i4).map_err(Err::convert)?;
 
     // less cr_cdt (u8), dst_ref (u16), src_ref (u16), class_options (u8)
-    if !(length >= 6) {
+    if length < 6 {
         return Err(Err::Error(make_error(i1, ErrorKind::Verify)));
     }
     let i6 = i5;