]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix lint warnings about if same then else
authorGabriel Lima Luz <gabriel.luz.lima@hotmail.com>
Fri, 14 Oct 2022 16:17:31 +0000 (13:17 -0300)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 09:20:10 +0000 (11:20 +0200)
Ticket: 4609

rust/src/http2/range.rs
rust/src/lib.rs
rust/src/nfs/nfs.rs

index 97d805996b476faf77087ddb62e6dafb2d79d43a..c1a50a5acf04efddabd59d2dee6436a18d8d3045 100644 (file)
@@ -134,7 +134,8 @@ pub fn http2_range_open(
     if v.end <= 0 || v.size <= 0 {
         // skipped for incomplete range information
         return;
-    } else if v.end == v.size - 1 && v.start == 0 {
+    }
+    if v.end == v.size - 1 && v.start == 0 {
         // whole file in one range
         return;
     }
index 42e2096b07ce2016ac5c900803a70ac477faa148..e9a38a67a163c1c268ef87dfc48a1257cb89401e 100644 (file)
@@ -36,7 +36,6 @@
 #![allow(clippy::extra_unused_lifetimes)]
 #![allow(clippy::field_reassign_with_default)]
 #![allow(clippy::for_loops_over_fallibles)]
-#![allow(clippy::if_same_then_else)]
 #![allow(clippy::manual_find)]
 #![allow(clippy::match_like_matches_macro)]
 #![allow(clippy::match_ref_pats)]
index 7f75f4308f3e691a45ecc637dfc992e17cb88fe0..9ca0fcf4feb8c6f39c2848fd877f5e01120b5ba1 100644 (file)
@@ -1669,13 +1669,13 @@ pub unsafe extern "C" fn rs_nfs_tx_get_alstate_progress(tx: *mut std::os::raw::c
 {
     let tx = cast_pointer!(tx, NFSTransaction);
     if direction == Direction::ToServer.into() && tx.request_done {
-        //SCLogNotice!("TOSERVER progress 1");
+        SCLogDebug!("TOSERVER progress 1");
         return 1;
     } else if direction == Direction::ToClient.into() && tx.response_done {
-        //SCLogNotice!("TOCLIENT progress 1");
+        SCLogDebug!("TOCLIENT progress 1");
         return 1;
     } else {
-        //SCLogNotice!("{} progress 0", direction);
+        SCLogDebug!("{} progress 0", direction);
         return 0;
     }
 }