tl 0.7.8

Fast HTML parser written in pure Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[inline(never)]
pub fn is_ident(c: u8) -> bool {
    (b'0'..=b'9').contains(&c)
        || (b'A'..=b'Z').contains(&c)
        || (b'a'..=b'z').contains(&c)
        || c == b'-'
        || c == b'_'
        || c == b':'
        || c == b'+'
        || c == b'/'
}

#[inline(always)]
pub fn to_lower(byte: u8) -> u8 {
    let is_upper = (byte >= b'A' && byte <= b'Z') as u8;
    let lower = is_upper * 0x20;
    byte + lower
}