use super::*;
pub trait ToWide {
fn to_wide_null(&self) -> Vec<u16>;
}
#[cfg(target_os = "windows")]
mod towide {
use super::*;
use std::os::windows::ffi::*;
impl<T> ToWide for T
where
T: AsRef<OsStr>,
{
fn to_wide_null(&self) -> Vec<u16> {
self.as_ref().encode_wide().chain(Some(0)).collect()
}
}
}
#[cfg(not(target_os = "windows"))]
mod towide {
use super::*;
impl<T> ToWide for T
where
T: AsRef<OsStr>,
{
fn to_wide_null(&self) -> Vec<u16> {
unreachable!()
}
}
}