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

Method casefold

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

Source from the content-addressed store, hash-verified

704 // casefold is much more aggressive than lower
705 #[pymethod]
706 fn casefold(&self) -> Self {
707 match self.as_str_kind() {
708 PyKindStr::Ascii(s) => caseless::default_case_fold_str(s.as_str()).into(),
709 PyKindStr::Utf8(s) => caseless::default_case_fold_str(s).into(),
710 PyKindStr::Wtf8(w) => w
711 .chunks()
712 .map(|c| match c {
713 Wtf8Chunk::Utf8(s) => Wtf8Buf::from_string(caseless::default_case_fold_str(s)),
714 Wtf8Chunk::Surrogate(c) => Wtf8Buf::from(c),
715 })
716 .collect::<Wtf8Buf>()
717 .into(),
718 }
719 }
720
721 #[pymethod]
722 fn upper(&self) -> Self {

Callers 1

_path_joinFunction · 0.45

Calls 4

as_str_kindMethod · 0.45
as_strMethod · 0.45
mapMethod · 0.45
chunksMethod · 0.45

Tested by

no test coverage detected