]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: Fix deprecation warnings
authorShivani Bhardwaj <shivanib134@gmail.com>
Fri, 26 Jul 2019 17:52:34 +0000 (23:22 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 19 Aug 2019 12:48:51 +0000 (14:48 +0200)
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
rust/src/lib.rs

index 11957c5871d150d1b26a0de492d061b6d5b5c4fd..0fdfc9c2ef5b03a6275e0452e147c9a6f9f6154c 100644 (file)
@@ -24,7 +24,7 @@ fn parse_len(input: &str) -> Result<u32, std::num::ParseIntError> {
 named!(pub parse_message<String>,
        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) >>
                (
index 4673e72665f4f5e7dfff020bb3fefe7518e1e586..03a3a3b45db10cf7a56625215bef84524967c555 100644 (file)
@@ -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]