From: Gabriel Lima Luz Date: Fri, 14 Oct 2022 16:17:31 +0000 (-0300) Subject: rust: fix lint warnings about if same then else X-Git-Tag: suricata-7.0.0-beta1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e90d17fd9c87eac848bb2bba6adce28fb79c5ec;p=thirdparty%2Fsuricata.git rust: fix lint warnings about if same then else Ticket: 4609 --- diff --git a/rust/src/http2/range.rs b/rust/src/http2/range.rs index 97d805996b..c1a50a5acf 100644 --- a/rust/src/http2/range.rs +++ b/rust/src/http2/range.rs @@ -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; } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 42e2096b07..e9a38a67a1 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -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)] diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index 7f75f4308f..9ca0fcf4fe 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -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; } }