(
s: &T,
)
| 456 | pub(crate) use env::split_paths; |
| 457 | #[cfg(target_os = "wasi")] |
| 458 | pub(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 | } |