From 6d39f6fd7dcc24932332eb8cf26f648cc56bd267 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Fri, 26 Jul 2019 23:22:34 +0530 Subject: [PATCH] rust: Fix deprecation warnings Fix the following warnings by compiler, (1) warning: use of deprecated item 'take_until_s': Please use `take_until` instead (2) warning: `...` range patterns are deprecated For the second warning, the builtin lint "ellipsis_inclusive_range_pattern" has been added which causes the following warning to show up with rustc 1.24. warning: unknown lint: `ellipsis_inclusive_range_patterns` --> /home/travis/build/OISF/suricata/suricata-5.0.0-dev/rust/src/lib.rs:18:10 | 18 | #![allow(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unknown_lints)] on by default Since there is no other way to fix this, the above warning shall stay. We need to take care of modifying this if and when the support for 1.24 as MSRV is dropped. --- rust/src/applayertemplate/parser.rs | 2 +- rust/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/src/applayertemplate/parser.rs b/rust/src/applayertemplate/parser.rs index 11957c5871..0fdfc9c2ef 100644 --- a/rust/src/applayertemplate/parser.rs +++ b/rust/src/applayertemplate/parser.rs @@ -24,7 +24,7 @@ fn parse_len(input: &str) -> Result { named!(pub parse_message, do_parse!( len: map_res!( - map_res!(take_until_s!(":"), std::str::from_utf8), parse_len) >> + map_res!(take_until!(":"), std::str::from_utf8), parse_len) >> _sep: take!(1) >> msg: take_str!(len) >> ( diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 4673e72665..03a3a3b45d 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -15,6 +15,7 @@ * 02110-1301, USA. */ +#![allow(ellipsis_inclusive_range_patterns)] // TODO: Remove when MSRV is higher than 1.24 #![cfg_attr(feature = "strict", deny(warnings))] #[macro_use]