`str::slice` works on byte indices, so it would make more sense if the function was called `str::slice_bytes`.