]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: remove unnecessary lifetimes 12223/head 12231/head
authorJason Ish <jason.ish@oisf.net>
Wed, 4 Dec 2024 18:31:37 +0000 (12:31 -0600)
committerJason Ish <jason.ish@oisf.net>
Wed, 4 Dec 2024 18:36:23 +0000 (12:36 -0600)
Fix provided by cargo clipy --fix.

Backport of 7bdbe7ed32d220abae62c0fc6ed8fcbeba886454.

rust/src/smb/nbss_records.rs
rust/src/smb/smb1_records.rs
rust/src/smb/smb2_records.rs
rust/src/snmp/snmp.rs
rust/src/ssh/parser.rs

index 6225eb47067e9d63b67e81d63a1512c07ff91a89..2fb643fd0c30e18566c1c03db4a74b3cd456d5e2 100644 (file)
@@ -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 |
index bf767da8b08b95945284843c4b648e0f4ea95110..eb42d2c04cb0d7d14b3aab5534afb21542bbff09 100644 (file)
@@ -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
     }
index 4a7721cdaa0ad64b102d0d56b75edfe8634ec750..d7f1eb0a1e7c041869cd4d5f68965d2972f2604b 100644 (file)
@@ -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
     }
index 6d67eb49e31cff62e3837407d307571643f3b5e3..1ff5b3f54bdd81d5a1b93bfc29dc7ada3d0b3870 100644 (file)
@@ -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
     }
index 0c57c88229d1b0eeca7bec375f4c77c5292a221a..b1733962c5e2b1558d0e4fbffb15be5cc6877321 100644 (file)
@@ -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<u8>, hassh: &mut Vec<u8>, to_server: &bool,
     ) {