// Multibyte case is a fn to allow char_range_at to inline cleanly
Multibyte case is a fn to allow char_range_at to inline cleanly
Multibyte case is a fn to allow char_range_at to inline cleanly
fn multibyte_char_range_at(bytes: &[u8], i: usize) -> (u32, usize) {
        let first = bytes[i];
        let w = UTF8_CHAR_WIDTH[first as usize];
        assert!(w != 0);
        let mut val = utf8_first_byte(first, w as u32);
        val = utf8_acc_cont_byte(val, bytes[i + 1]);
        if w > 2 { val = utf8_acc_cont_byte(val, bytes[i + 2]); }
        if w > 3 { val = utf8_acc_cont_byte(val, bytes[i + 3]); }
        return (val, i + w as usize);
    }
fn multibyte_char_range_at ( bytes : & [ u8 ] , i : usize ) -> ( u32 , usize ) { let first = bytes [ i ] ; let w = UTF8_CHAR_WIDTH [ first as usize ] ; assert ! ( w 0 ) ; let mut val = utf8_first_byte ( first , w as u32 ) ; val = utf8_acc_cont_byte ( val , bytes [ i + 1 ] ) ; if w > 2 { val = utf8_acc_cont_byte ( val , bytes [ i + 2 ] ) ; } if w > 3 { val = utf8_acc_cont_byte ( val , bytes [ i + 3 ] ) ; } return ( val , i + w as usize ) ; }
Multibyte case is a fn to allow char_range_at to inline cleanly
Multibyte case is a fn to allow char_range_at to inline cleanly
bytes
&[u8]
i
usize