diff options
author | Wez Furlong <wez@wezfurlong.org> | 2019-07-23 18:00:14 -0700 |
---|---|---|
committer | Wez Furlong <wez@wezfurlong.org> | 2019-07-29 08:55:06 -0700 |
commit | f8967b396e7e85072d8eb39654e366c1db5f8e73 (patch) | |
tree | 3390e61253bfa945f4177d55d2ddab3435764ef6 /src | |
parent | f39200feee2937eb12f312a7634a067fac0c80db (diff) | |
download | ssh2-rs-f8967b396e7e85072d8eb39654e366c1db5f8e73.zip |
remove SessionBinding trait
I'd gradually removed the usage of it while I was hacking through
with my lifetime changes. I suppose it could be added back
but I confess that I removed it because I found it confusing
and it didn't look like it would fit on my first pass through
the code.
Diffstat (limited to 'src')
-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; |