fn parse_4_digits(ascii: &[u8]) -> Option<u16> {
    if ascii.len() == 4 {
        if let (Some(b0), Some(b1), Some(b2), Some(b3)) = (
            digit(ascii[0]),
            digit(ascii[1]),
            digit(ascii[2]),
            digit(ascii[3]),
        ) {
            return Some(
                u16::from(b0) * 1000
                    + u16::from(b1) * 100
                    + u16::from(b2) * 10
                    + u16::from(b3),
            );
        }
    }
    None
}
/// Parse a 4-digit ASCII decimal number
Parse a 4-digit ASCII decimal number
Parse a 4 - digit ASCII decimal number
fn parse_4_digits(ascii: &[u8]) -> Option<u16> {
    if ascii.len() == 4 {
        if let (Some(b0), Some(b1), Some(b2), Some(b3)) = (
            digit(ascii[0]),
            digit(ascii[1]),
            digit(ascii[2]),
            digit(ascii[3]),
        ) {
            return Some(
                u16::from(b0) * 1000
                    + u16::from(b1) * 100
                    + u16::from(b2) * 10
                    + u16::from(b3),
            );
        }
    }
    None
}
fn parse_4_digits ( ascii : & [ u8 ] ) -> Option < u16 > { if ascii . len ( ) == 4 { if let ( Some ( b0 ) , Some ( b1 ) , Some ( b2 ) , Some ( b3 ) ) = ( digit ( ascii [ 0 ] ) , digit ( ascii [ 1 ] ) , digit ( ascii [ 2 ] ) , digit ( ascii [ 3 ] ) , ) { return Some ( u16 :: from ( b0 ) * 1000 + u16 :: from ( b1 ) * 100 + u16 :: from ( b2 ) * 10 + u16 :: from ( b3 ) , ) ; } } None }
Parse a 4-digit ASCII decimal number
Parse a 4 - digit ASCII decimal number
ascii
&[u8]