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

Function split_paths

src/settings.rs:458–467  ·  view source on GitHub ↗
(
    s: &T,
)

Source from the content-addressed store, hash-verified

456pub(crate) use env::split_paths;
457#[cfg(target_os = "wasi")]
458pub(crate) fn split_paths<T: AsRef<std::ffi::OsStr> + ?Sized>(
459 s: &T,
460) -> impl Iterator<Item = std::path::PathBuf> + '_ {
461 let s = s.as_ref().as_encoded_bytes();
462 s.split(|b| *b == b':').map(|x| {
463 unsafe { std::ffi::OsStr::from_encoded_bytes_unchecked(x) }
464 .to_owned()
465 .into()
466 })
467}

Callers 2

get_pathsFunction · 0.85
collect_stdlib_pathsFunction · 0.85

Calls 4

as_refMethod · 0.45
mapMethod · 0.45
splitMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected