Fix copy-paste error in String::as_mut_vec() docs

This commit is contained in:
nyanpasu64 2021-10-25 18:42:22 -07:00
parent 17e13b549f
commit 6b90c0f1b4
1 changed files with 5 additions and 4 deletions

View File

@ -1500,10 +1500,11 @@ impl String {
/// ///
/// # Safety /// # Safety
/// ///
/// This function is unsafe because it does not check that the bytes passed /// This function is unsafe because the returned `&mut Vec` allows writing
/// to it are valid UTF-8. If this constraint is violated, it may cause /// bytes which are not valid UTF-8. If this constraint is violated, using
/// memory unsafety issues with future users of the `String`, as the rest of /// the original `String` after dropping the `&mut Vec` may violate memory
/// the standard library assumes that `String`s are valid UTF-8. /// safety, as the rest of the standard library assumes that `String`s are
/// valid UTF-8.
/// ///
/// # Examples /// # Examples
/// ///