Function bparse::digit

source ·
pub fn digit(input: &[u8]) -> Option<Matches<'_, 1>>
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().value(), b"1");
assert_eq!(digit.test(b"a"), None);