diff options
Diffstat (limited to 'tests/test01.rs')
-rw-r--r-- | tests/test01.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/test01.rs b/tests/test01.rs index 1559888..45c0dca 100644 --- a/tests/test01.rs +++ b/tests/test01.rs @@ -1,5 +1,4 @@ -#[macro_use] -extern crate nom; +use nom::bytes::complete::take; #[test] fn test01() { @@ -7,13 +6,11 @@ fn test01() { let _ = x509_parser::parse_x509_certificate(data); } -named!(parser02<&[u8],()>, - do_parse!( - _hdr: take!(1) >> - _data: take!(18_446_744_073_709_551_615) >> - ( () ) - ) -); +fn parser02(input: &[u8]) -> nom::IResult<&[u8], ()> { + let (_hdr, input) = take(1_usize)(input)?; + let (_data, input) = take(18_446_744_073_709_551_615_usize)(input)?; + Ok((input, ())) +} #[test] fn test02() { |