Function bparse::digit

source ·
pub fn digit(input: &[u8]) -> Option<(&[u8], &[u8])>
Expand description

A pattern that fails if the byte at the start of the input is not an ascii digit

§Example

use bparse::{Pattern, digit};
assert_eq!(digit.test(b"1").unwrap().0, b"1");
assert_eq!(digit.test(b"a"), None);