diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/util.rs b/src/util.rs index ac6c722..db27303 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::path::Path; -use {raw, Error, Session}; +use {raw, Error}; #[doc(hidden)] pub trait Binding: Sized { @@ -11,22 +11,6 @@ pub trait Binding: Sized { fn raw(&self) -> Self::Raw; } -#[doc(hidden)] -pub trait SessionBinding<'sess>: Sized { - type Raw; - - unsafe fn from_raw(sess: &'sess Session, raw: *mut Self::Raw) -> Self; - fn raw(&self) -> *mut Self::Raw; - - unsafe fn from_raw_opt(sess: &'sess Session, raw: *mut Self::Raw) -> Result<Self, Error> { - if raw.is_null() { - Err(Error::last_error(sess).unwrap_or_else(Error::unknown)) - } else { - Ok(SessionBinding::from_raw(sess, raw)) - } - } -} - #[cfg(unix)] pub fn path2bytes(p: &Path) -> Result<Cow<[u8]>, Error> { use std::ffi::OsStr; |