wchar_ffi.rs: implement from_ffi() for more FFI strings

This commit is contained in:
Johannes Altmanninger 2023-02-04 11:21:42 +01:00
parent dcca3cfe3c
commit c8bf2be408

View file

@ -127,8 +127,20 @@ pub trait WCharFromFFI<Target> {
fn from_ffi(&self) -> Target;
}
impl WCharFromFFI<WString> for cxx::CxxWString {
fn from_ffi(&self) -> WString {
WString::from_chars(self.as_chars())
}
}
impl WCharFromFFI<WString> for cxx::UniquePtr<cxx::CxxWString> {
fn from_ffi(&self) -> WString {
WString::from_chars(self.as_chars())
}
}
impl WCharFromFFI<WString> for cxx::SharedPtr<cxx::CxxWString> {
fn from_ffi(&self) -> WString {
WString::from_chars(self.as_chars())
}
}