Commit 6da69ec
committed
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).1 parent 5db778a commit 6da69ec
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2384 | 2384 | | |
2385 | 2385 | | |
2386 | 2386 | | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
| 2387 | + | |
2390 | 2388 | | |
2391 | | - | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
2392 | 2395 | | |
2393 | 2396 | | |
2394 | 2397 | | |
| |||
0 commit comments