Skip to content

Commit

Permalink
Fix copy-paste error in String::as_mut_vec() docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanpasu64 committed Oct 26, 2021
1 parent 17e13b5 commit 6b90c0f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,10 +1500,11 @@ impl String {
///
/// # Safety
///
/// This function is unsafe because it does not check that the bytes passed
/// to it are valid UTF-8. If this constraint is violated, it may cause
/// memory unsafety issues with future users of the `String`, as the rest of
/// the standard library assumes that `String`s are valid UTF-8.
/// This function is unsafe because the returned `&mut Vec` allows writing
/// bytes which are not valid UTF-8. If this constraint is violated, using
/// the original `String` after dropping the `&mut Vec` may violate memory
/// safety, as the rest of the standard library assumes that `String`s are
/// valid UTF-8.
///
/// # Examples
///
Expand Down

0 comments on commit 6b90c0f

Please sign in to comment.