crate::ix!();
#[inline]
pub fn is_digit(c: u8) -> bool {
let res = c >= b'0' && c <= b'9';
trace!("is_digit({}) = {}", c, res);
res
}
#[inline]
pub fn is_space(c: u8) -> bool {
let res = matches!(c, b' ' | b'\n' | b'\r' | b'\t' | 0x0C | 0x0B );
trace!("is_space({}) = {}", c, res);
res
}
#[cfg(test)]
mod tests_check {
use super::*;
#[traced_test]
fn non_digits_are_rejected() {
for c in [b'/', b':', b'A', b'z', b' '] {
assert!(!is_digit(c));
}
}
#[traced_test]
fn whitespace_detection() {
for &c in [b' ', b'\n', b'\r', b'\t', 0x0C, 0x0B].iter() {
assert!(is_space(c));
}
for c in [b'a', b'0', b'#'] {
assert!(!is_space(c));
}
}
}