fn snap_to_char_boundary_floor(buf: &[u8], idx: usize) -> usizeExpand description
Snap idx down to the nearest UTF-8 character boundary (or 0).
A byte is a UTF-8 char boundary iff it’s either ASCII (< 0x80) or
a leading byte (>= 0xC0). Continuation bytes are in 0x80..=0xBF.
idx == buf.len() is always a valid boundary (one past the end).