From 825eadf1c5a689ee175ba5ec7b8b79c8791ebe09 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 4 Dec 2024 12:31:37 -0600 Subject: [PATCH] rust: remove unnecessary lifetimes Fix provided by cargo clipy --fix. Backport of 7bdbe7ed32d220abae62c0fc6ed8fcbeba886454. --- rust/src/smb/nbss_records.rs | 2 +- rust/src/smb/smb1_records.rs | 2 +- rust/src/smb/smb2_records.rs | 2 +- rust/src/snmp/snmp.rs | 2 +- rust/src/ssh/parser.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/src/smb/nbss_records.rs b/rust/src/smb/nbss_records.rs index 6225eb4706..2fb643fd0c 100644 --- a/rust/src/smb/nbss_records.rs +++ b/rust/src/smb/nbss_records.rs @@ -34,7 +34,7 @@ pub struct NbssRecord<'a> { pub data: &'a[u8], } -impl<'a> NbssRecord<'a> { +impl NbssRecord<'_> { pub fn is_valid(&self) -> bool { let valid = match self.message_type { NBSS_MSGTYPE_SESSION_MESSAGE | diff --git a/rust/src/smb/smb1_records.rs b/rust/src/smb/smb1_records.rs index bf767da8b0..eb42d2c04c 100644 --- a/rust/src/smb/smb1_records.rs +++ b/rust/src/smb/smb1_records.rs @@ -817,7 +817,7 @@ pub struct SmbRecord<'a> { pub data: &'a[u8], } -impl<'a> SmbRecord<'a> { +impl SmbRecord<'_> { pub fn has_unicode_support(&self) -> bool { self.flags2 & 0x8000_u16 != 0 } diff --git a/rust/src/smb/smb2_records.rs b/rust/src/smb/smb2_records.rs index 4a7721cdaa..d7f1eb0a1e 100644 --- a/rust/src/smb/smb2_records.rs +++ b/rust/src/smb/smb2_records.rs @@ -65,7 +65,7 @@ pub struct Smb2Record<'a> { pub data: &'a [u8], } -impl<'a> Smb2Record<'a> { +impl Smb2Record<'_> { pub fn is_request(&self) -> bool { self.direction == 0 } diff --git a/rust/src/snmp/snmp.rs b/rust/src/snmp/snmp.rs index 6d67eb49e3..1ff5b3f54b 100644 --- a/rust/src/snmp/snmp.rs +++ b/rust/src/snmp/snmp.rs @@ -82,7 +82,7 @@ pub struct SNMPTransaction<'a> { tx_data: applayer::AppLayerTxData, } -impl<'a> Transaction for SNMPTransaction<'a> { +impl Transaction for SNMPTransaction<'_> { fn id(&self) -> u64 { self.id } diff --git a/rust/src/ssh/parser.rs b/rust/src/ssh/parser.rs index 0c57c88229..b1733962c5 100644 --- a/rust/src/ssh/parser.rs +++ b/rust/src/ssh/parser.rs @@ -167,7 +167,7 @@ pub struct SshPacketKeyExchange<'a> { const SSH_HASSH_STRING_DELIMITER_SLICE: [u8; 1] = [b';']; -impl<'a> SshPacketKeyExchange<'a> { +impl SshPacketKeyExchange<'_> { pub fn generate_hassh( &self, hassh_string: &mut Vec, hassh: &mut Vec, to_server: &bool, ) { -- 2.47.2