]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix cargo tests
authorPierre Chifflier <chifflier@wzdftpd.net>
Fri, 8 Feb 2019 13:45:57 +0000 (14:45 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 8 Feb 2019 15:21:44 +0000 (16:21 +0100)
rust/src/applayertemplate/parser.rs

index dc56fbeaf5ae018343fba0bcb9e7662c3a5c394f..11957c5871d150d1b26a0de492d061b6d5b5c4fd 100644 (file)
@@ -45,17 +45,18 @@ mod tests {
 
         let result = parse_message(buf);
         match result {
-            IResult::Done(remainder, message) => {
+            Ok((remainder, message)) => {
                 // Check the first message.
                 assert_eq!(message, "Hello World!");
 
                 // And we should have 6 bytes left.
                 assert_eq!(remainder.len(), 6);
             }
-            IResult::Incomplete(_) => {
+            Err(Err::Incomplete(_)) => {
                 panic!("Result should not have been incomplete.");
             }
-            IResult::Error(err) => {
+            Err(Err::Error(err)) |
+            Err(Err::Failure(err)) => {
                 panic!("Result should not be an error: {:?}.", err);
             }
         }