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

Method as_bytes

crates/vm/src/function/fspath.rs:92–98  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

90 }
91
92 pub fn as_bytes(&self) -> &[u8] {
93 // TODO: FS encodings
94 match self {
95 Self::Str(s) => s.as_bytes(),
96 Self::Bytes(b) => b.as_bytes(),
97 }
98 }
99
100 pub fn to_string_lossy(&self) -> Cow<'_, str> {
101 match self {

Callers 5

as_os_strMethod · 0.45
to_cstringMethod · 0.45
borrow_bytesMethod · 0.45
with_refMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected