fn snap_to_char_boundary(s: &str, index: usize) -> usize
Snap a byte index back to the nearest valid UTF-8 char boundary.