diff --git a/rust/src/ike/ike.rs b/rust/src/ike/ike.rs index f476653654..8c58fdd9b1 100644 --- a/rust/src/ike/ike.rs +++ b/rust/src/ike/ike.rs @@ -163,7 +163,7 @@ impl IKEState { .transactions .iter() .position(|tx| tx.tx_id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); } diff --git a/rust/src/krb/krb5.rs b/rust/src/krb/krb5.rs index e8bb499349..d1fabaead1 100644 --- a/rust/src/krb/krb5.rs +++ b/rust/src/krb/krb5.rs @@ -218,7 +218,7 @@ impl KRB5State { fn free_tx(&mut self, tx_id: u64) { let tx = self.transactions.iter().position(|tx| tx.id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); } diff --git a/rust/src/ntp/ntp.rs b/rust/src/ntp/ntp.rs index 257c9e7c37..5b3601a2b3 100644 --- a/rust/src/ntp/ntp.rs +++ b/rust/src/ntp/ntp.rs @@ -136,7 +136,7 @@ impl NTPState { fn free_tx(&mut self, tx_id: u64) { let tx = self.transactions.iter().position(|tx| tx.id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); } diff --git a/rust/src/sip/sip.rs b/rust/src/sip/sip.rs index 6d7dd5d04e..cb2bf03556 100755 --- a/rust/src/sip/sip.rs +++ b/rust/src/sip/sip.rs @@ -103,7 +103,7 @@ impl SIPState { .transactions .iter() .position(|tx| tx.id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); } diff --git a/rust/src/smb/auth.rs b/rust/src/smb/auth.rs index f3efdf874a..6c9d9c47f5 100644 --- a/rust/src/smb/auth.rs +++ b/rust/src/smb/auth.rs @@ -132,7 +132,7 @@ fn parse_secblob_spnego(blob: &[u8]) -> Option } } - if have_ntlmssp && kticket == None { + if have_ntlmssp && kticket.is_none() { SCLogDebug!("parsing expected NTLMSSP"); ntlmssp = parse_ntlmssp_blob(os); } diff --git a/rust/src/smb/smb1.rs b/rust/src/smb/smb1.rs index 1b80ba11c3..5ca1da5207 100644 --- a/rust/src/smb/smb1.rs +++ b/rust/src/smb/smb1.rs @@ -646,7 +646,7 @@ fn smb1_response_record_one<'b>(state: &mut SMBState, r: &SmbRecord<'b>, command }, _ => { None }, }; - if d == None { + if d.is_none() { tx.set_event(SMBEvent::NegotiateMalformedDialects); } (true, d) @@ -865,7 +865,7 @@ pub fn smb1_trans_request_record<'b>(state: &mut SMBState, r: &SmbRecord<'b>) /* if we have a fid, store it so the response can pick it up */ let mut pipe_dcerpc = false; - if rd.pipe != None { + if rd.pipe.is_some() { let pipe = rd.pipe.unwrap(); state.ssn2vec_map.insert(SMBCommonHdr::from1(r, SMBHDR_TYPE_GUID), pipe.fid.to_vec()); diff --git a/rust/src/smb/smb1_records.rs b/rust/src/smb/smb1_records.rs index 6f602ceffe..32e73fe511 100644 --- a/rust/src/smb/smb1_records.rs +++ b/rust/src/smb/smb1_records.rs @@ -114,7 +114,7 @@ pub fn parse_smb1_write_andx_request_record(i : &[u8], andx_offset: usize) -> IR let (i, _padding_evasion) = cond(data_offset > ax+4+2*(wct as u16), |b| take(data_offset - (ax+4+2*(wct as u16)))(b))(i)?; let (i, file_data) = rest(i)?; let record = Smb1WriteRequestRecord { - offset: if high_offset != None { ((high_offset.unwrap() as u64) << 32)|(offset as u64) } else { 0 }, + offset: if high_offset.is_some() { ((high_offset.unwrap() as u64) << 32)|(offset as u64) } else { 0 }, len: (((data_len_high as u32) << 16) as u32)|(data_len_low as u32), fid, data: file_data, @@ -514,7 +514,7 @@ pub fn parse_smb_read_andx_request_record(i: &[u8]) -> IResult<&[u8], SmbRequest let record = SmbRequestReadAndXRecord { fid, size: (((max_count_high as u64) << 16)|max_count_low as u64), - offset: if high_offset != None { ((high_offset.unwrap() as u64) << 32)|(offset as u64) } else { 0 }, + offset: if high_offset.is_some() { ((high_offset.unwrap() as u64) << 32)|(offset as u64) } else { 0 }, }; Ok((i, record)) } diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index eeaa8e832f..f2f2e59b74 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -218,7 +218,7 @@ impl<'a> SNMPState<'a> { fn free_tx(&mut self, tx_id: u64) { let tx = self.transactions.iter().position(|tx| tx.id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); } diff --git a/rust/src/tftp/tftp.rs b/rust/src/tftp/tftp.rs index 232e47102d..7716ec8ea3 100644 --- a/rust/src/tftp/tftp.rs +++ b/rust/src/tftp/tftp.rs @@ -55,7 +55,7 @@ impl TFTPState { fn free_tx(&mut self, tx_id: u64) { let tx = self.transactions.iter().position(|tx| tx.id == tx_id + 1); - debug_assert!(tx != None); + debug_assert!(tx.is_some()); if let Some(idx) = tx { let _ = self.transactions.remove(idx); }