also fix bad use of shared ref in split_at_mut · rust-lang/rust@66c894e (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit 66c894e

also fix bad use of shared ref in split_at_mut

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -2516,7 +2516,7 @@ impl str {
2516 2516 // is_char_boundary checks that the index is in [0, .len()]
2517 2517 if self.is_char_boundary(mid) {
2518 2518 let len = self.len();
2519 -let ptr = self.as_ptr() as *mut u8;
2519 +let ptr = self.as_mut_ptr();
2520 2520 unsafe {
2521 2521 (from_utf8_unchecked_mut(slice::from_raw_parts_mut(ptr, mid)),
2522 2522 from_utf8_unchecked_mut(slice::from_raw_parts_mut(