mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
wchar_ffi.rs: implement from_ffi() for more FFI strings
This commit is contained in:
parent
dcca3cfe3c
commit
c8bf2be408
1 changed files with 12 additions and 0 deletions
|
@ -127,8 +127,20 @@ pub trait WCharFromFFI<Target> {
|
||||||
fn from_ffi(&self) -> 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> {
|
impl WCharFromFFI<WString> for cxx::UniquePtr<cxx::CxxWString> {
|
||||||
fn from_ffi(&self) -> WString {
|
fn from_ffi(&self) -> WString {
|
||||||
WString::from_chars(self.as_chars())
|
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())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue