]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix clippy lint for single_char_add_str
authorJason Ish <jason.ish@oisf.net>
Mon, 3 Oct 2022 21:44:06 +0000 (15:44 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 4 Oct 2022 09:22:02 +0000 (11:22 +0200)
Idiomatic cleanup and a fix automatically done by `cargo clippy --fix`.

rust/src/quic/frames.rs

index 91526ac508d4d5a82c67306856c644ace05b73a5..14ee239f37fc74ad291f7e33b9ab853f82a0d73d 100644 (file)
@@ -203,14 +203,14 @@ pub struct QuicTlsExtension {
 }
 
 fn quic_tls_ja3_client_extends(ja3: &mut String, exts: Vec<TlsExtension>) {
-    ja3.push_str(",");
+    ja3.push(',');
     let mut dash = false;
     for e in &exts {
         match e {
             TlsExtension::EllipticCurves(x) => {
                 for ec in x {
                     if dash {
-                        ja3.push_str("-");
+                        ja3.push('-');
                     } else {
                         dash = true;
                     }
@@ -220,14 +220,14 @@ fn quic_tls_ja3_client_extends(ja3: &mut String, exts: Vec<TlsExtension>) {
             _ => {}
         }
     }
-    ja3.push_str(",");
+    ja3.push(',');
     dash = false;
     for e in &exts {
         match e {
             TlsExtension::EcPointFormats(x) => {
                 for ec in *x {
                     if dash {
-                        ja3.push_str("-");
+                        ja3.push('-');
                     } else {
                         dash = true;
                     }
@@ -250,7 +250,7 @@ fn quic_get_tls_extensions(
             for e in &exts {
                 let etype = TlsExtensionType::from(e);
                 if dash {
-                    ja3.push_str("-");
+                    ja3.push('-');
                 } else {
                     dash = true;
                 }
@@ -289,17 +289,17 @@ fn parse_quic_handshake(msg: TlsMessage) -> Option<Frame> {
             ClientHello(ch) => {
                 let mut ja3 = String::with_capacity(256);
                 ja3.push_str(&u16::from(ch.version).to_string());
-                ja3.push_str(",");
+                ja3.push(',');
                 let mut dash = false;
                 for c in &ch.ciphers {
                     if dash {
-                        ja3.push_str("-");
+                        ja3.push('-');
                     } else {
                         dash = true;
                     }
                     ja3.push_str(&u16::from(*c).to_string());
                 }
-                ja3.push_str(",");
+                ja3.push(',');
                 let ciphers = ch.ciphers;
                 let extv = quic_get_tls_extensions(ch.ext, &mut ja3, true);
                 return Some(Frame::Crypto(Crypto { ciphers, extv, ja3 }));
@@ -307,9 +307,9 @@ fn parse_quic_handshake(msg: TlsMessage) -> Option<Frame> {
             ServerHello(sh) => {
                 let mut ja3 = String::with_capacity(256);
                 ja3.push_str(&u16::from(sh.version).to_string());
-                ja3.push_str(",");
+                ja3.push(',');
                 ja3.push_str(&u16::from(sh.cipher).to_string());
-                ja3.push_str(",");
+                ja3.push(',');
                 let ciphers = vec![sh.cipher];
                 let extv = quic_get_tls_extensions(sh.ext, &mut ja3, false);
                 return Some(Frame::Crypto(Crypto { ciphers, extv, ja3 }));