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

Method to_string_lossy

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

Source from the content-addressed store, hash-verified

509 }
510
511 pub fn to_string_lossy(&self) -> Cow<'_, str> {
512 self.to_str()
513 .map(Cow::Borrowed)
514 .unwrap_or_else(|| self.as_wtf8().to_string_lossy())
515 }
516
517 pub const fn kind(&self) -> StrKind {
518 self.data.kind()

Callers 13

slot_initMethod · 0.45
fromMethod · 0.45
spawnveFunction · 0.45
decode_source_bytesFunction · 0.45
compileFunction · 0.45
to_strFunction · 0.45
strftimeFunction · 0.45
struct_time_from_tmFunction · 0.45
strsignalFunction · 0.45
load_library_unixFunction · 0.45
dlsymFunction · 0.45
strerrorFunction · 0.45

Calls 3

to_strMethod · 0.80
mapMethod · 0.45
as_wtf8Method · 0.45

Tested by

no test coverage detected