Function bparse::range

source ·
pub fn range(lo: u8, hi: u8) -> ByteRange
Expand description

Returns a pattern that will match any byte in the closed interval [lo, hi]

§Example

use bparse::{Pattern, range};

let digit = range(b'0', b'9');

assert_eq!(digit.test(b"1").unwrap().0, b"1");
assert_eq!(digit.test(b"a"), None);