(slice: &Wtf8, index: usize)
| 1287 | /// Copied from str::is_char_boundary |
| 1288 | #[inline] |
| 1289 | fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool { |
| 1290 | if index == 0 { |
| 1291 | return true; |
| 1292 | } |
| 1293 | match slice.bytes.get(index) { |
| 1294 | None => index == slice.len(), |
| 1295 | Some(&b) => (b as i8) >= -0x40, |
| 1296 | } |
| 1297 | } |
| 1298 | |
| 1299 | /// Verify that `index` is at the edge of either a valid UTF-8 codepoint |
| 1300 | /// (i.e. a codepoint that's not a surrogate) or of the whole string. |
no test coverage detected