summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-27 16:00:58 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-27 16:00:58 -0700
commit77a42d9315d690a99ebf51fd872d6df56356eeef (patch)
tree7200d4368b47ae74af1421a5f32a0f6909e9ed45
parente8f19a4ab194d9c242a008db08c190ddbdc74926 (diff)
downloadssh2-rs-77a42d9315d690a99ebf51fd872d6df56356eeef.zip
Remove usage of AsOsStr
-rw-r--r--src/lib.rs2
-rw-r--r--src/util.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9da2a4c..443f9f5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -124,7 +124,7 @@
//! ```
#![doc(html_root_url = "http://alexcrichton.com/ssh2-rs")]
-#![feature(unsafe_destructor, std_misc, collections, io, io_ext, convert)]
+#![feature(unsafe_destructor, collections, io, io_ext, convert)]
#![allow(trivial_numeric_casts)]
#![deny(missing_docs, unused_results)]
#![cfg_attr(test, deny(warnings))]
diff --git a/src/util.rs b/src/util.rs
index 357cdce..c2936b6 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -30,8 +30,9 @@ pub trait SessionBinding<'sess>: Sized {
#[cfg(unix)]
pub fn path2bytes(p: &Path) -> Result<&[u8], Error> {
use std::os::unix::prelude::*;
- use std::ffi::AsOsStr;
- check(p.as_os_str().as_bytes())
+ use std::ffi::OsStr;
+ let s: &OsStr = p.as_ref();
+ check(s.as_bytes())
}
#[cfg(windows)]
pub fn path2bytes(p: &Path) -> Result<&[u8], Error> {