Skip to content

Commit 66c894e

Browse files
committed
also fix bad use of shared ref in split_at_mut
1 parent a996f2c commit 66c894e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ impl str {
25162516
// is_char_boundary checks that the index is in [0, .len()]
25172517
if self.is_char_boundary(mid) {
25182518
let len = self.len();
2519-
let ptr = self.as_ptr() as *mut u8;
2519+
let ptr = self.as_mut_ptr();
25202520
unsafe {
25212521
(from_utf8_unchecked_mut(slice::from_raw_parts_mut(ptr, mid)),
25222522
from_utf8_unchecked_mut(slice::from_raw_parts_mut(

0 commit comments

Comments
 (0)