(&self)
| 2581 | /// View as `PyStrInterned` (widening: UTF-8 → WTF-8). |
| 2582 | #[inline] |
| 2583 | pub fn as_interned_str(&self) -> &PyStrInterned { |
| 2584 | // Safety: PyUtf8Str is #[repr(transparent)] over PyStr, |
| 2585 | // so PyInterned<PyUtf8Str> has the same layout as PyInterned<PyStr>. |
| 2586 | unsafe { &*(self as *const Self as *const PyStrInterned) } |
| 2587 | } |
| 2588 | |
| 2589 | /// Narrow a `PyStrInterned` to `PyUtf8StrInterned`. |
| 2590 | /// |