]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: remove unnecessary lifetimes
authorJason Ish <jason.ish@oisf.net>
Thu, 28 Nov 2024 15:53:00 +0000 (09:53 -0600)
committerVictor Julien <victor@inliniac.net>
Fri, 29 Nov 2024 19:37:38 +0000 (20:37 +0100)
Fix provided by cargo clippy --fix.

rust/src/ldap/filters.rs
rust/src/ldap/types.rs
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
rust/src/x509/mod.rs

index 434642ad0fe354ff14d616eecdcdea3df34864d0..caa846767f61d342b0e47ad0a988b6e4e3116471 100644 (file)
@@ -33,7 +33,7 @@ pub enum Filter {
     ExtensibleMatch(MatchingRuleAssertion),
 }
 
-impl<'a> From<ldap_parser::filter::Filter<'a>> for Filter {
+impl From<ldap_parser::filter::Filter<'_>> for Filter {
     fn from(f: ldap_parser::filter::Filter) -> Self {
         match f {
             ldap_parser::filter::Filter::And(val) => {
@@ -123,7 +123,7 @@ pub struct PartialAttribute {
     pub attr_vals: Vec<AttributeValue>,
 }
 
-impl<'a> From<&ldap_parser::filter::PartialAttribute<'a>> for PartialAttribute {
+impl From<&ldap_parser::filter::PartialAttribute<'_>> for PartialAttribute {
     fn from(value: &ldap_parser::filter::PartialAttribute) -> Self {
         let attr_type = LdapString(value.attr_type.0.to_string());
         let attr_vals: Vec<AttributeValue> = value
@@ -145,7 +145,7 @@ pub struct Attribute {
     pub attr_vals: Vec<AttributeValue>,
 }
 
-impl<'a> From<&ldap_parser::filter::Attribute<'a>> for Attribute {
+impl From<&ldap_parser::filter::Attribute<'_>> for Attribute {
     fn from(value: &ldap_parser::filter::Attribute) -> Self {
         let attr_type = LdapString(value.attr_type.0.to_string());
         let attr_vals: Vec<AttributeValue> = value
@@ -166,7 +166,7 @@ pub struct AttributeValueAssertion {
     pub attribute_desc: LdapString,
     pub assertion_value: Vec<u8>,
 }
-impl<'a> From<&ldap_parser::filter::AttributeValueAssertion<'a>> for AttributeValueAssertion {
+impl From<&ldap_parser::filter::AttributeValueAssertion<'_>> for AttributeValueAssertion {
     fn from(value: &ldap_parser::filter::AttributeValueAssertion) -> Self {
         let attribute_desc = LdapString(value.attribute_desc.0.to_string());
         let assertion_value = value.assertion_value.to_vec();
@@ -203,7 +203,7 @@ pub enum Substring {
     Any(AssertionValue),
     Final(AssertionValue),
 }
-impl<'a> From<ldap_parser::filter::Substring<'a>> for Substring {
+impl From<ldap_parser::filter::Substring<'_>> for Substring {
     fn from(value: ldap_parser::filter::Substring) -> Self {
         match value {
             ldap_parser::filter::Substring::Initial(val) => {
index 7b79a32e0154625f8a82ea3eae0f5d29da91da92..901201b4a35ea1ea8f2523f3601aa6a5789cc148 100644 (file)
@@ -342,7 +342,7 @@ pub struct Control {
     pub control_value: Option<Vec<u8>>,
 }
 
-impl<'a> From<ldap_parser::ldap::LdapMessage<'a>> for LdapMessage {
+impl From<ldap_parser::ldap::LdapMessage<'_>> for LdapMessage {
     fn from(ldap_msg: ldap_parser::ldap::LdapMessage) -> Self {
         let message_id = MessageID(ldap_msg.message_id.0);
         let protocol_op = match ldap_msg.protocol_op {
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 7de9e6607dda3cf77dc22d8998f5fe31f98a1d0d..909f08e9e46847f9021b2d8542ab9295d31d404a 100644 (file)
@@ -60,7 +60,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 4e1afd0566e37581a3ffd43ff0af4ae2a9a96c98..c0a121d13a45c88f7359334d285d0b762f296757 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 ea5f9bd2889b68a0152aa64355fc25c43bcfb1c2..f3403cf25df8fee92e0aa50f5fafe243221391d2 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,
     ) {
index e7cdbe885c2b99d6737bb15e4e7d9a6b172649f9..83f6ae656ed0c7575f2589be9f9ec0a06fcf1fd4 100644 (file)
@@ -50,7 +50,7 @@ pub struct X509(X509Certificate<'static>);
 
 pub struct SCGeneralName<'a>(&'a GeneralName<'a>);
 
-impl<'a> fmt::Display for SCGeneralName<'a> {
+impl fmt::Display for SCGeneralName<'_> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.0 {
             GeneralName::DNSName(s) => write!(f, "{}", s),