]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
http2: remove needless borrows
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 8 Sep 2021 01:44:25 +0000 (07:14 +0530)
committerVictor Julien <vjulien@oisf.net>
Fri, 19 Nov 2021 16:20:01 +0000 (17:20 +0100)
rust/src/http2/detect.rs

index 94e8f7d30879c4a54d9a027d81dc8960fe306f49..f08acd523b18163439bddfe2e159b28d1b57135e 100644 (file)
@@ -566,7 +566,7 @@ fn http2_frames_get_header_value<'a>(
         tx.escaped.push(vec);
         let idx = tx.escaped.len() - 1;
         let value = &tx.escaped[idx];
-        return Ok(&value);
+        return Ok(value);
     }
 }
 
@@ -884,7 +884,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header(
             for i in 0..tx.frames_ts.len() {
                 if let Some(blocks) = http2_header_blocks(&tx.frames_ts[i]) {
                     if nb < pos + blocks.len() as u32 {
-                        let ehdr = http2_escape_header(&blocks, nb - pos);
+                        let ehdr = http2_escape_header(blocks, nb - pos);
                         tx.escaped.push(ehdr);
                         let idx = tx.escaped.len() - 1;
                         let value = &tx.escaped[idx];
@@ -901,7 +901,7 @@ pub unsafe extern "C" fn rs_http2_tx_get_header(
             for i in 0..tx.frames_tc.len() {
                 if let Some(blocks) = http2_header_blocks(&tx.frames_tc[i]) {
                     if nb < pos + blocks.len() as u32 {
-                        let ehdr = http2_escape_header(&blocks, nb - pos);
+                        let ehdr = http2_escape_header(blocks, nb - pos);
                         tx.escaped.push(ehdr);
                         let idx = tx.escaped.len() - 1;
                         let value = &tx.escaped[idx];