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

Method expect_str

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

Source from the content-addressed store, hash-verified

486 #[inline]
487 #[track_caller]
488 pub fn expect_str(&self) -> &str {
489 self.to_str().expect("PyStr contains surrogates")
490 }
491
492 pub(crate) fn ensure_valid_utf8(&self, vm: &VirtualMachine) -> PyResult<()> {
493 if self.is_utf8() {

Callers 15

run_shellFunction · 0.80
get_pipFunction · 0.80
complete_optMethod · 0.80
into_js_valueMethod · 0.80
new_from_strMethod · 0.80
fetchFunction · 0.80
queryMethod · 0.80
get_attrMethod · 0.80
set_attrMethod · 0.80
load_moduleFunction · 0.80
make_stdout_objectFunction · 0.80
register_converterFunction · 0.80

Calls 1

to_strMethod · 0.80

Tested by

no test coverage detected