Loading openssl/src/bio.rs +16 −1 Original line number Diff line number Diff line Loading @@ -63,9 +63,13 @@ impl MemBio { unsafe { let mut ptr = ptr::null_mut(); let len = ffi::BIO_get_mem_data(self.0, &mut ptr); if len == 0 { &[] } else { slice::from_raw_parts(ptr as *const _ as *const _, len as usize) } } } #[cfg(not(boringssl))] pub unsafe fn from_ptr(bio: *mut ffi::BIO) -> MemBio { Loading @@ -83,3 +87,14 @@ cfg_if! { } } } #[cfg(test)] mod tests { use super::MemBio; #[test] fn test_mem_bio_get_buf_empty() { let b = MemBio::new().unwrap(); assert_eq!(b.get_buf(), &[]); } } Loading
openssl/src/bio.rs +16 −1 Original line number Diff line number Diff line Loading @@ -63,9 +63,13 @@ impl MemBio { unsafe { let mut ptr = ptr::null_mut(); let len = ffi::BIO_get_mem_data(self.0, &mut ptr); if len == 0 { &[] } else { slice::from_raw_parts(ptr as *const _ as *const _, len as usize) } } } #[cfg(not(boringssl))] pub unsafe fn from_ptr(bio: *mut ffi::BIO) -> MemBio { Loading @@ -83,3 +87,14 @@ cfg_if! { } } } #[cfg(test)] mod tests { use super::MemBio; #[test] fn test_mem_bio_get_buf_empty() { let b = MemBio::new().unwrap(); assert_eq!(b.get_buf(), &[]); } }