Commit b7f6a0b
authored
Rollup merge of #72773 - Rantanen:is_char_boundary-docs, r=joshtriplett
Fix is_char_boundary documentation
Given the "start _and/or end_" wording in the original, the way I understood it was that the `str::is_char_boundary` method would also return `true` for the last byte in a UTF-8 code point sequence. (Which would have meant that for a string consisting of nothing but 1 and 2 byte UTF-8 code point sequences, it would return nothing but `true`.)
In practice the method returns `true` only for the starting byte of each sequence and the end of the string: [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e9f5fc4d6bf2f1bf57a75f3c9a180770)
I was also somewhat tempted to remove the _The start and end of the string are considered to be boundaries_, since that's implied by the first sentence, but I decided to avoid bikeshedding over it and left it as it was since it's not wrong in relation to how the method behaves.1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2270 | 2270 | | |
2271 | 2271 | | |
2272 | 2272 | | |
2273 | | - | |
2274 | | - | |
| 2273 | + | |
| 2274 | + | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | | - | |
2278 | | - | |
| 2277 | + | |
2279 | 2278 | | |
2280 | 2279 | | |
2281 | 2280 | | |
| |||
0 commit comments