(&self, index: usize)
| 320 | } |
| 321 | |
| 322 | pub fn nth_char(&self, index: usize) -> CodePoint { |
| 323 | match self.as_str_kind() { |
| 324 | PyKindStr::Ascii(s) => s[index].into(), |
| 325 | PyKindStr::Utf8(s) => s.chars().nth(index).unwrap().into(), |
| 326 | PyKindStr::Wtf8(w) => w.code_points().nth(index).unwrap(), |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | impl core::fmt::Display for StrData { |
no test coverage detected