Commit 7c7b649
authored
Rollup merge of #74381 - mbrubeck:docs, r=Mark-Simulacrum
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 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2374 | 2374 | | |
2375 | 2375 | | |
2376 | 2376 | | |
2377 | | - | |
2378 | | - | |
2379 | | - | |
| 2377 | + | |
2380 | 2378 | | |
2381 | | - | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
2382 | 2385 | | |
2383 | 2386 | | |
2384 | 2387 | | |
| |||
0 commit comments