MCPcopy Index your code
hub / github.com/RustPython/RustPython / as_interned_str

Method as_interned_str

crates/vm/src/builtins/str.rs:2583–2587  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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 ///

Callers 3

get_innerMethod · 0.45
_containsMethod · 0.45
replaceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected