(value: &OsStr, prefix: &str)
| 413 | |
| 414 | #[cfg(unix)] |
| 415 | fn attached_non_utf8_value(value: &OsStr, prefix: &str) -> Option<OsString> { |
| 416 | use std::os::unix::ffi::{OsStrExt as _, OsStringExt as _}; |
| 417 | |
| 418 | let bytes = value.as_bytes(); |
| 419 | let prefix = prefix.as_bytes(); |
| 420 | bytes |
| 421 | .strip_prefix(prefix) |
| 422 | .map(|suffix| OsString::from_vec(suffix.to_vec())) |
| 423 | } |
| 424 | |
| 425 | #[cfg(windows)] |
| 426 | fn attached_non_utf8_value(value: &OsStr, prefix: &str) -> Option<OsString> { |
no test coverage detected