(&self)
| 278 | |
| 279 | #[inline] |
| 280 | pub fn as_str_kind(&self) -> PyKindStr<'_> { |
| 281 | match self.kind { |
| 282 | StrKind::Ascii => { |
| 283 | PyKindStr::Ascii(unsafe { AsciiStr::from_ascii_unchecked(self.data.as_bytes()) }) |
| 284 | } |
| 285 | StrKind::Utf8 => { |
| 286 | PyKindStr::Utf8(unsafe { core::str::from_utf8_unchecked(self.data.as_bytes()) }) |
| 287 | } |
| 288 | StrKind::Wtf8 => PyKindStr::Wtf8(&self.data), |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | #[inline] |
| 293 | pub fn len(&self) -> usize { |