]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/applayer: collapse nested if let to remove clippy warning 13244/head
authorJason Ish <jason.ish@oisf.net>
Fri, 16 May 2025 00:39:51 +0000 (18:39 -0600)
committerVictor Julien <victor@inliniac.net>
Fri, 16 May 2025 04:45:28 +0000 (06:45 +0200)
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
   = note: `#[warn(clippy::collapsible_match)]` on by default

rust/derive/src/applayerstate.rs

index 58e3cebb2ec883e4a0d1ebe1be55234e4df19f29..3155f6103ca241f54175f440a25c1db6c5dbafb2 100644 (file)
@@ -24,14 +24,12 @@ fn get_attr_strip_prefix(attr: &syn::Attribute) -> String {
     let meta = attr.parse_meta().unwrap();
     if let syn::Meta::List(l) = meta {
         for n in l.nested {
-            if let syn::NestedMeta::Meta(m2) = n {
-                if let syn::Meta::NameValue(nv) = m2 {
-                    if nv.path.is_ident("alstate_strip_prefix") {
-                        if let syn::Lit::Str(s) = nv.lit {
-                            return s.value();
-                        }
-                        panic!("strip_prefix invalid syntax");
+            if let syn::NestedMeta::Meta(syn::Meta::NameValue(nv)) = n {
+                if nv.path.is_ident("alstate_strip_prefix") {
+                    if let syn::Lit::Str(s) = nv.lit {
+                        return s.value();
                     }
+                    panic!("strip_prefix invalid syntax");
                 }
             }
         }