Remove BufMut::bytes_vectored_mut() (#430)

There are issues with regard to uninitialized memory. We are avoiding
stabilizing this function for now.
This commit is contained in:
Carl Lerche
2020-10-16 11:56:03 -07:00
committed by GitHub
parent 422048eb24
commit 447530b8a6
4 changed files with 0 additions and 121 deletions
-19
View File
@@ -1,7 +1,5 @@
#![warn(rust_2018_idioms)]
#[cfg(feature = "std")]
use bytes::buf::IoSliceMut;
use bytes::{BufMut, BytesMut};
use core::fmt::Write;
use core::usize;
@@ -66,23 +64,6 @@ fn test_clone() {
assert!(buf != buf2);
}
#[cfg(feature = "std")]
#[test]
fn test_bufs_vec_mut() {
let b1: &mut [u8] = &mut [];
let b2: &mut [u8] = &mut [];
let mut dst = [IoSliceMut::from(b1), IoSliceMut::from(b2)];
// with no capacity
let mut buf = BytesMut::new();
assert_eq!(buf.capacity(), 0);
assert_eq!(1, buf.bytes_vectored_mut(&mut dst[..]));
// with capacity
let mut buf = BytesMut::with_capacity(64);
assert_eq!(1, buf.bytes_vectored_mut(&mut dst[..]));
}
#[test]
fn test_mut_slice() {
let mut v = vec![0, 0, 0, 0];