diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-01-23 08:31:49 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-23 08:31:49 -0800 |
commit | f125dbfd31473fc5958955ac7546b06fafd04530 (patch) | |
tree | 5100979de152fe7923df7be0aa62da32180e3af1 /src | |
parent | e2f2c5046f6079d80ed21ae21afc55249dff478a (diff) | |
download | ssh2-rs-f125dbfd31473fc5958955ac7546b06fafd04530.zip |
Update to rust master
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.rs | 2 | ||||
-rw-r--r-- | src/error.rs | 4 | ||||
-rw-r--r-- | src/sftp.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/channel.rs b/src/channel.rs index 149c1fb..7dabcb8 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -220,7 +220,7 @@ impl<'sess> Channel<'sess> { let data = match self.read_limit { Some(amt) => { let len = data.len(); - data.slice_to_mut(cmp::min(amt as usize, len)) + &mut data[..cmp::min(amt as usize, len)] } None => data, }; diff --git a/src/error.rs b/src/error.rs index 641116e..24946ad 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,7 +7,7 @@ use {raw, Session}; use util::Binding; /// Representation of an error that can occur within libssh2 -#[derive(Show)] +#[derive(Debug)] #[allow(missing_copy_implementations)] pub struct Error { code: libc::c_int, @@ -103,7 +103,7 @@ impl Error { pub fn code(&self) -> libc::c_int { self.code } } -impl fmt::String for Error { +impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "[{}] {}", self.code, self.msg) } diff --git a/src/sftp.rs b/src/sftp.rs index d6058ea..ec9dd39 100644 --- a/src/sftp.rs +++ b/src/sftp.rs @@ -452,7 +452,7 @@ impl<'sftp> Writer for File<'sftp> { detail: Some(self.sftp.last_error().to_string()), }) } - buf = buf.slice_from(rc as usize); + buf = &buf[rc as usize..]; } Ok(()) } |