diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 6821a6f1298a..9bc12c2170d3 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1783,11 +1783,7 @@ impl String { // ahead. This is safe because sufficient capacity was just reserved, and `idx` // is a char boundary. unsafe { - ptr::copy( - self.vec.as_ptr().add(idx), - self.vec.as_mut_ptr().add(idx + amt), - len - idx, - ); + ptr::copy(self.vec.as_ptr().add(idx), self.vec.as_mut_ptr().add(idx + amt), len - idx); } // SAFETY: Copy the new string slice into the vacated region if `idx != len`,