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

Method try_downcast_from

crates/vm/src/builtins/str.rs:2040–2043  ·  view source on GitHub ↗
(obj: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2038 }
2039
2040 fn try_downcast_from(obj: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
2041 let str = obj.try_downcast_ref::<PyStr>(vm)?;
2042 str.ensure_valid_utf8(vm)
2043 }
2044}
2045
2046impl<'a> From<&'a AsciiStr> for PyUtf8Str {

Callers

nothing calls this directly

Calls 1

ensure_valid_utf8Method · 0.80

Tested by

no test coverage detected