pub fn bytes_cmp<'a, C, I>(s: &'static [u8], cmp: C) -> BytesCmp<C, I>
Expand description
Parses the bytes s
using cmp
to compare each token.
If you have a stream implementing RangeStream
such as &[u8]
you can also use the
range
parser which may be more efficient.
use std::ascii::AsciiExt;
let result = bytes_cmp(&b"abc"[..], |l, r| l.eq_ignore_ascii_case(&r))
.parse(&b"AbC"[..]);
assert_eq!(result, Ok((&b"abc"[..], &b""[..])));