From 0f639d7ea1bdf542f42e5d011dcea77beb3d65c9 Mon Sep 17 00:00:00 2001 From: Kirpal Grewal Date: Sun, 27 Oct 2024 13:25:51 +0000 Subject: [PATCH] correct mutability --- library/core/src/str/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index bace37ef1443b..e7dcd16fc78d2 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -785,8 +785,8 @@ impl str { // SAFETY: caller guarantees `mid` is on a char boundary. unsafe { ( - from_utf8_unchecked_mut(slice::from_raw_parts(ptr, mid)), - from_utf8_unchecked_mut(slice::from_raw_parts(ptr.add(mid), len - mid)), + from_utf8_unchecked(slice::from_raw_parts(ptr, mid)), + from_utf8_unchecked(slice::from_raw_parts(ptr.add(mid), len - mid)), ) } }