aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2013-12-15 21:48:49 -0800
committerSteven Fackler <[email protected]>2013-12-15 21:48:49 -0800
commit3047782f78f30d20941d2cff360e2b9599171d8f (patch)
tree4b9776234ec281cd6c7788f109568692ace42586
parentMove docs to github (diff)
downloadrust-openssl-3047782f78f30d20941d2cff360e2b9599171d8f.tar.xz
rust-openssl-3047782f78f30d20941d2cff360e2b9599171d8f.zip
Fix for vec API changes
-rw-r--r--lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.rs b/lib.rs
index b55dd051..8839897c 100644
--- a/lib.rs
+++ b/lib.rs
@@ -356,12 +356,12 @@ impl Ssl {
}
fn read(&self, buf: &mut [u8]) -> c_int {
- unsafe { ffi::SSL_read(self.ssl, vec::raw::to_ptr(buf) as *c_void,
+ unsafe { ffi::SSL_read(self.ssl, buf.as_ptr() as *c_void,
buf.len() as c_int) }
}
fn write(&self, buf: &[u8]) -> c_int {
- unsafe { ffi::SSL_write(self.ssl, vec::raw::to_ptr(buf) as *c_void,
+ unsafe { ffi::SSL_write(self.ssl, buf.as_ptr() as *c_void,
buf.len() as c_int) }
}
@@ -420,7 +420,7 @@ impl Drop for MemBio {
impl MemBio {
fn read(&self, buf: &mut [u8]) -> Option<uint> {
let ret = unsafe {
- ffi::BIO_read(self.bio, vec::raw::to_ptr(buf) as *c_void,
+ ffi::BIO_read(self.bio, buf.as_ptr() as *c_void,
buf.len() as c_int)
};
@@ -433,7 +433,7 @@ impl MemBio {
fn write(&self, buf: &[u8]) {
let ret = unsafe {
- ffi::BIO_write(self.bio, vec::raw::to_ptr(buf) as *c_void,
+ ffi::BIO_write(self.bio, buf.as_ptr() as *c_void,
buf.len() as c_int)
};
assert_eq!(buf.len(), ret as uint);