aboutsummaryrefslogtreecommitdiff
path: root/src/bio
diff options
context:
space:
mode:
authorValerii Hiora <[email protected]>2014-09-28 07:09:57 +0300
committerValerii Hiora <[email protected]>2014-09-28 07:18:45 +0300
commit3f413e9354238919bce6dc87e3415919f301d487 (patch)
treec0b446d704cc6f220e7535ec49d6ec37406ea83e /src/bio
parentCertificate/pkey generation & PEM export (diff)
downloadrust-openssl-3f413e9354238919bce6dc87e3415919f301d487.tar.xz
rust-openssl-3f413e9354238919bce6dc87e3415919f301d487.zip
Addressed review comments
- fixed invalid file permissions - removed redundand mem::transmute - removed outdated FIXME's - removed redundand temporary variable - removed macro_export for internal macros
Diffstat (limited to 'src/bio')
-rw-r--r--src/bio/mod.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bio/mod.rs b/src/bio/mod.rs
index 019129ea..f81114de 100644
--- a/src/bio/mod.rs
+++ b/src/bio/mod.rs
@@ -43,10 +43,9 @@ impl MemBio {
/// Consumes current bio and returns wrapped value
/// Note that data ownership is lost and
/// should be handled manually
- pub unsafe fn unwrap(self) -> *mut ffi::BIO {
- let mut t = self;
- t.owned = false;
- t.bio
+ pub unsafe fn unwrap(mut self) -> *mut ffi::BIO {
+ self.owned = false;
+ self.bio
}
/// Temporarily gets wrapped value
@@ -57,7 +56,6 @@ impl MemBio {
impl Reader for MemBio {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
- // FIXME: merge with read
let ret = unsafe {
ffi::BIO_read(self.bio, buf.as_ptr() as *mut c_void,
buf.len() as c_int)
@@ -74,7 +72,6 @@ impl Reader for MemBio {
impl Writer for MemBio {
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
- // FIXME: merge with write
let ret = unsafe {
ffi::BIO_write(self.bio, buf.as_ptr() as *const c_void,
buf.len() as c_int)