From: Pierre Chifflier Date: Fri, 8 Feb 2019 13:45:57 +0000 (+0100) Subject: rust: fix cargo tests X-Git-Tag: suricata-5.0.0-beta1~224 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e7f261a883d8221fae18f3b7900fdf9d8c9f126;p=thirdparty%2Fsuricata.git rust: fix cargo tests --- diff --git a/rust/src/applayertemplate/parser.rs b/rust/src/applayertemplate/parser.rs index dc56fbeaf5..11957c5871 100644 --- a/rust/src/applayertemplate/parser.rs +++ b/rust/src/applayertemplate/parser.rs @@ -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); } }