Create ByteBuf with MutByteBuf::with_capacity

This commit is contained in:
Carl Lerche
2016-08-23 14:22:39 -07:00
parent be23af6bb7
commit 38abb8074b
5 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ use std::io;
#[test]
pub fn test_readijng_buf_from_reader() {
let mut reader = chunks(vec![b"foo", b"bar", b"baz"]);
let mut buf = ByteBuf::mut_with_capacity(1024);
let mut buf = MutByteBuf::with_capacity(1024);
assert_eq!(3, reader.read_buf(&mut buf).unwrap());
assert_eq!(Bytes::from(&b"foo"), Bytes::from(buf.flip()));