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

index d150488881719ffee40b2619721ead541d0ddfd6..c150d11839fa880509dd60d1f86f9b4e87d2953a 100644 (file)
@@ -153,12 +153,7 @@ impl RdpState {
     }
 
     fn get_tx(&self, tx_id: u64) -> Option<&RdpTransaction> {
-        for tx in &self.transactions {
-            if tx.id == tx_id {
-                return Some(tx);
-            }
-        }
-        return None;
+        self.transactions.iter().find(|&tx| tx.id == tx_id)
     }
 
     fn new_tx(&mut self, item: RdpTransactionItem) -> RdpTransaction {