Lines Matching refs:slice
825 /// The slice returned is guaranteed to be valid UTF-8 for all possible values
826 /// of `slice`.
829 fn symbolic_name_normalize_bytes(slice: &mut [u8]) -> &mut [u8] {
835 if slice.len() >= 2 {
837 starts_with_is = slice[0..2] == b"is"[..]
838 || slice[0..2] == b"IS"[..]
839 || slice[0..2] == b"iS"[..]
840 || slice[0..2] == b"Is"[..];
846 for i in start..slice.len() {
847 // VALIDITY ARGUMENT: To guarantee that the resulting slice is valid
848 // UTF-8, we ensure that the slice contains only ASCII bytes. In
850 let b = slice[i];
854 slice[next_write] = b + (b'a' - b'A');
857 slice[next_write] = b;
865 if starts_with_is && next_write == 1 && slice[0] == b'c' {
866 slice[0] = b'i';
867 slice[1] = b's';
868 slice[2] = b'c';
871 &mut slice[..next_write]