]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix compiler warning
authorShivani Bhardwaj <shivanib134@gmail.com>
Tue, 16 Jul 2019 08:39:13 +0000 (14:09 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Jul 2019 14:09:37 +0000 (16:09 +0200)
rustc 1.36 introduced:

error: variable does not need to be mutable
   --> src/dhcp/parser.rs:202:17
    |
202 |             let mut malformed_options = false;
    |                 ----^^^^^^^^^^^^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
note: lint level defined here
   --> src/lib.rs:18:38
    |
18  | #![cfg_attr(feature = "strict", deny(warnings))]
    |                                      ^^^^^^^^
    = note: #[deny(unused_mut)] implied by #[deny(warnings)]

error: aborting due to previous error

error: Could not compile `suricata`.

Ticket #3072.

rust/src/dhcp/parser.rs

index 6b7402cd7b16bfe1fcac8f15484f7ae30c75829c..55a1be60379cdc4c387995050ad80e12ce015f5e 100644 (file)
@@ -199,7 +199,7 @@ pub fn dhcp_parse(input: &[u8]) -> IResult<&[u8], DHCPMessage> {
         Ok((rem, header)) => {
             let mut options = Vec::new();
             let mut next = rem;
-            let mut malformed_options = false;
+            let malformed_options = false;
             let mut truncated_options = false;
             loop {
                 match parse_option(next) {