use std::ffi::OsStr;
use std::path::{Path, PathBuf};
pub fn _ari_path_append(destination: &mut PathBuf, path: impl AsRef<Path>) {
let path = path.as_ref();
let os = path.as_os_str();
let bytes = os_str_as_u8_slice(os);
if bytes.is_empty() {
destination.push(os);
} else {
for bit in bytes.split(|x| *x == b'/' || *x == b'\\') {
destination.push(unsafe { u8_slice_as_os_str(bit) });
}
}
}
fn os_str_as_u8_slice(os: &OsStr) -> &[u8] {
unsafe { &*(os as *const OsStr as *const [u8]) }
}
unsafe fn u8_slice_as_os_str(slice: &[u8]) -> &OsStr {
&*(slice as *const [u8] as *const OsStr)
}