]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lints for clippy::map_flatten
authorJason Ish <jason.ish@oisf.net>
Wed, 5 Oct 2022 15:02:39 +0000 (09:02 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 09:20:09 +0000 (11:20 +0200)
rust/src/common.rs

index 7c2e4f5d4df0260280be5516ce3bc49b1a26ef39..a8880b2c4c029be8e32c8d6b7da5f29453740d7d 100644 (file)
@@ -106,13 +106,12 @@ pub unsafe extern "C" fn rs_cstring_free(s: *mut c_char) {
 pub fn to_hex(input: &[u8]) -> String {
     return input
         .iter()
-        .map(|b| {
+        .flat_map(|b| {
             vec![
                 char::from(HEX[(b >> 4) as usize]),
                 char::from(HEX[(b & 0xf) as usize]),
             ]
         })
-        .flatten()
         .collect();
 }