]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lint for unneeded late initialization
authorJason Ish <jason.ish@oisf.net>
Fri, 14 Oct 2022 17:59:20 +0000 (11:59 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 09:20:10 +0000 (11:20 +0200)
rust/src/smb/debug.rs

index 15d8748c0a5702e77c70bc653e111e90fa5cf256..3f706a09fcf5293113bac4545f89331757d40577 100644 (file)
@@ -42,14 +42,13 @@ impl SMBState {
         for i in 0..len {
             let tx = &self.transactions[i];
             let ver = tx.vercmd.get_version();
-            let _smbcmd;
-            if ver == 2 {
+            let _smbcmd = if ver == 2 {
                 let (_, cmd) = tx.vercmd.get_smb2_cmd();
-                _smbcmd = cmd;
+                cmd
             } else {
                 let (_, cmd) = tx.vercmd.get_smb1_cmd();
-                _smbcmd = cmd as u16;
-            }
+                cmd as u16
+            };
 
             match tx.type_data {
                 Some(SMBTransactionTypeData::FILE(ref d)) => {