fn validate_frame_id(id: &[u8]) -> bool {
    // Only frame IDs with 3 or 4 characters are valid.
    if id.len() != 4 && id.len() != 3 {
        return false;
    }

    // Character:   '/'   [ '0'  ...  '9' ]  ':'  ...  '@'  [ 'A'  ...  'Z' ]   '['
    // ASCII Code:  0x2f  [ 0x30 ... 0x39 ]  0x3a ... 0x40  [ 0x41 ... 0x5a ]  0x5b
    id.iter().filter(|&b| !((*b >= b'0' && *b <= b'9') || (*b >= b'A' && *b <= b'Z'))).count() == 0
}
/// Validates that a frame id only contains the uppercase letters A-Z, and digits 0-9.
Validates that a frame id only contains the uppercase letters A-Z, and digits 0-9.
Validates that a frame id only contains the uppercase letters A - Z and digits 0 - 9 .
fn validate_frame_id(id: &[u8]) -> bool {
    // Only frame IDs with 3 or 4 characters are valid.
    if id.len() != 4 && id.len() != 3 {
        return false;
    }
    // Character:   '/'   [ '0'  ...  '9' ]  ':'  ...  '@'  [ 'A'  ...  'Z' ]   '['
    // ASCII Code:  0x2f  [ 0x30 ... 0x39 ]  0x3a ... 0x40  [ 0x41 ... 0x5a ]  0x5b
    id.iter().filter(|&b| !((*b >= b'0' && *b <= b'9') || (*b >= b'A' && *b <= b'Z'))).count() == 0
}
fn validate_frame_id ( id : & [ u8 ] ) -> bool { // Only frame IDs with 3 or 4 characters are valid. if id . len ( ) != 4 && id . len ( ) != 3 { return false ; } // Character:   '/'   [ '0'  ...  '9' ]  ':'  ...  '@'  [ 'A'  ...  'Z' ]   '[' // ASCII Code:  0x2f  [ 0x30 ... 0x39 ]  0x3a ... 0x40  [ 0x41 ... 0x5a ]  0x5b id . iter ( ) . filter ( | & b | ! ( ( * b >= b'0' && * b <= b'9' ) || ( * b >= b'A' && * b <= b'Z' ) ) ) . count ( ) == 0 }
Validates that a frame id only contains the uppercase letters A-Z, and digits 0-9.
Validates that a frame id only contains the uppercase letters A - Z and digits 0 - 9 .
id
&[u8]
id
&[u8]