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

Method slice_pystr

crates/vm/src/stdlib/_io.rs:3659–3666  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

3657
3658 #[inline]
3659 fn slice_pystr(self, vm: &VirtualMachine) -> PyStrRef {
3660 if self.is_full_slice() {
3661 self.0
3662 } else {
3663 // TODO: try to use Arc::get_mut() on the str?
3664 PyStr::from(self.slice()).into_ref(&vm.ctx)
3665 }
3666 }
3667
3668 fn utf8_len(&self) -> Utf8size {
3669 Utf8size {

Callers 1

readlineMethod · 0.80

Calls 3

is_full_sliceMethod · 0.80
into_refMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected