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

Method as_str

crates/vm/src/intern.rs:151–155  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

149 /// Most interned strings are valid UTF-8, so this is an ergonomic default.
150 #[inline]
151 pub fn as_str(&self) -> &str {
152 self.inner
153 .to_str()
154 .unwrap_or_else(|| panic!("interned str is always valid UTF-8"))
155 }
156}
157
158impl<T: PyPayload> PyInterned<T> {

Callers 15

format_internalFunction · 0.45
formatFunction · 0.45
calculate_prefixFunction · 0.45
write_traceback_entryFunction · 0.45
lookupMethod · 0.45
resolveMethod · 0.45
call_native_encode_errorFunction · 0.45
call_native_decode_errorFunction · 0.45
key_hashMethod · 0.45
key_isMethod · 0.45
key_eqMethod · 0.45
key_as_isizeMethod · 0.45

Calls 1

to_strMethod · 0.80

Tested by

no test coverage detected