]> git.lizzy.rs Git - rust.git/commit
Update docs for str::as_bytes_mut.
authorMatt Brubeck <mbrubeck@limpet.net>
Wed, 15 Jul 2020 20:21:02 +0000 (13:21 -0700)
committerMatt Brubeck <mbrubeck@limpet.net>
Wed, 15 Jul 2020 21:36:12 +0000 (14:36 -0700)
commit6da69ec08c4ba0c166d28a65196832f8de877149
tree18c861ee05f025b4defa6b70a49d5655b0500e8e
parent5db778affee7c6600c8e7a177c48282dab3f6292
Update docs for str::as_bytes_mut.

* Add "Safety" section describing UTF-8 invariant.

* Remove mention of `from_utf8_mut`.  It is not necessary to call
  a function to convert the byte slice back to a string slice.  The
  original string becomes accessible again after the byte slice is
  no longer used (as shown in the example code).
src/libcore/str/mod.rs