diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs index 96cb1c5..258aa59 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::path::Path; -use {raw, Error}; +use {raw, Error, ErrorCode}; #[cfg(unix)] pub fn path2bytes(p: &Path) -> Result<Cow<[u8]>, Error> { @@ -16,7 +16,7 @@ pub fn path2bytes(p: &Path) -> Result<Cow<[u8]>, Error> { .map(|s| s.as_bytes()) .ok_or_else(|| { Error::new( - raw::LIBSSH2_ERROR_INVAL, + ErrorCode::Session(raw::LIBSSH2_ERROR_INVAL), "only unicode paths on windows may be used", ) }) @@ -40,7 +40,7 @@ pub fn path2bytes(p: &Path) -> Result<Cow<[u8]>, Error> { fn check(b: Cow<[u8]>) -> Result<Cow<[u8]>, Error> { if b.iter().any(|b| *b == 0) { Err(Error::new( - raw::LIBSSH2_ERROR_INVAL, + ErrorCode::Session(raw::LIBSSH2_ERROR_INVAL), "path provided contains a 0 byte", )) } else { |