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

Method slice

crates/vm/src/stdlib/_sre.rs:67–71  ·  view source on GitHub ↗
(&self, start: usize, end: usize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

65
66 impl SreStr for &[u8] {
67 fn slice(&self, start: usize, end: usize, vm: &VirtualMachine) -> PyObjectRef {
68 vm.ctx
69 .new_bytes(self.iter().take(end).skip(start).cloned().collect())
70 .into()
71 }
72 }
73
74 impl SreStr for &Wtf8 {

Callers 1

get_sliceMethod · 0.45

Calls 7

collectMethod · 0.80
code_pointsMethod · 0.80
new_bytesMethod · 0.45
skipMethod · 0.45
takeMethod · 0.45
iterMethod · 0.45
new_strMethod · 0.45

Tested by

no test coverage detected