diff options
Diffstat (limited to 'third_party/rust/libloading/src/error.rs')
-rw-r--r-- | third_party/rust/libloading/src/error.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/third_party/rust/libloading/src/error.rs b/third_party/rust/libloading/src/error.rs index bd70ec39ce..ff4891c901 100644 --- a/third_party/rust/libloading/src/error.rs +++ b/third_party/rust/libloading/src/error.rs @@ -1,4 +1,4 @@ -use std::ffi::CString; +use std::ffi::{CString, CStr}; /// A `dlerror` error. pub struct DlDescription(pub(crate) CString); @@ -9,6 +9,12 @@ impl std::fmt::Debug for DlDescription { } } +impl From<&CStr> for DlDescription { + fn from(value: &CStr) -> Self { + Self(value.into()) + } +} + /// A Windows API error. pub struct WindowsError(pub(crate) std::io::Error); |