diff options
author | Alex Crichton <alex@alexcrichton.com> | 2014-11-24 22:43:48 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2014-11-24 22:43:48 -0800 |
commit | 4971597defab4d423734b06087c41e4439bb32c5 (patch) | |
tree | 8bfe80e4fa454809eae207d09abd8fa7a8bc77bd /src | |
parent | 922531da4c22abe7a216672314315d41769d7fb1 (diff) | |
download | ssh2-rs-4971597defab4d423734b06087c41e4439bb32c5.zip |
Update to rust master
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.rs | 3 | ||||
-rw-r--r-- | src/error.rs | 2 | ||||
-rw-r--r-- | src/session.rs | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/channel.rs b/src/channel.rs index 45249d0..6f951f2 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -1,7 +1,6 @@ use std::cmp; use std::io; use std::kinds::marker; -use std::vec; use libc::{c_uint, c_int, size_t, c_char, c_void, c_uchar}; use {raw, Session, Error}; @@ -249,7 +248,7 @@ impl<'a> Channel<'a> { unsafe fn convert(chan: &Channel, ptr: *mut c_char, len: size_t) -> Option<String> { if ptr.is_null() { return None } - let ret = vec::raw::from_buf(ptr as *const u8, len as uint); + let ret = Vec::from_raw_buf(ptr as *const u8, len as uint); raw::libssh2_free(chan.sess.raw(), ptr as *mut c_void); String::from_utf8(ret).ok() } diff --git a/src/error.rs b/src/error.rs index baf82a5..f8938db 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,7 +22,7 @@ impl Error { let rc = raw::libssh2_session_last_error(sess.raw(), &mut msg, 0 as *mut _, 0); if rc == 0 { return None } - Some(Error::new(rc, str::raw::c_str_to_static_slice(msg as *const _))) + Some(Error::new(rc, str::from_c_str(msg as *const _))) } } diff --git a/src/session.rs b/src/session.rs index 18d5a23..0fcee0c 100644 --- a/src/session.rs +++ b/src/session.rs @@ -224,7 +224,7 @@ impl Session { &mut ptr); if rc <= 0 { try!(self.rc(rc)) } for i in range(0, rc as int) { - ret.push(str::raw::c_str_to_static_slice(*ptr.offset(i))); + ret.push(str::from_c_str(*ptr.offset(i))); } raw::libssh2_free(self.raw, ptr as *mut c_void); } @@ -441,7 +441,7 @@ impl Session { if ret.is_null() { Err(Error::last_error(self).unwrap()) } else { - Ok(str::raw::c_str_to_static_slice(ret)) + Ok(str::from_c_str(ret)) } } } |