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

Method strip

crates/vm/src/bytes_inner.rs:606–614  ·  view source on GitHub ↗
(&self, chars: OptionalOption<Self>)

Source from the content-addressed store, hash-verified

604 }
605
606 pub fn strip(&self, chars: OptionalOption<Self>) -> Vec<u8> {
607 self.elements
608 .py_strip(
609 chars,
610 |s, chars| s.trim_with(|c| chars.contains(&(c as u8))),
611 |s| s.trim(),
612 )
613 .to_vec()
614 }
615
616 pub fn lstrip(&self, chars: OptionalOption<Self>) -> &[u8] {
617 self.elements.py_strip(

Callers 15

test_demoFunction · 0.45
_print_panicMethod · 0.45
getSuiteDescriptionMethod · 0.45
builtin_str.pyFile · 0.45
builtin_bytes.pyFile · 0.45
from_strMethod · 0.45
extract_enum_bodyFunction · 0.45
build_deoptsFunction · 0.45
parse_updated_lib_issueFunction · 0.45

Calls 4

to_vecMethod · 0.80
py_stripMethod · 0.80
trimMethod · 0.80
containsMethod · 0.45

Tested by 3

test_demoFunction · 0.36
_print_panicMethod · 0.36
getSuiteDescriptionMethod · 0.36