summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-23 08:31:49 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-23 08:31:49 -0800
commitf125dbfd31473fc5958955ac7546b06fafd04530 (patch)
tree5100979de152fe7923df7be0aa62da32180e3af1 /src
parente2f2c5046f6079d80ed21ae21afc55249dff478a (diff)
downloadssh2-rs-f125dbfd31473fc5958955ac7546b06fafd04530.zip
Update to rust master
Diffstat (limited to 'src')
-rw-r--r--src/channel.rs2
-rw-r--r--src/error.rs4
-rw-r--r--src/sftp.rs2
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(())
}