mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-19 00:00:12 +02:00
Create ByteBuf with MutByteBuf::with_capacity
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user