diff options
author | Haibo Huang <hhb@google.com> | 2021-01-11 19:30:56 -0800 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2021-01-11 19:30:56 -0800 |
commit | 49f37ac424d7df1f8ee1989d8f3b5ceb6b6a9ea0 (patch) | |
tree | 9fee875946571b5e3156284b964bf3617ced0ca1 /tests/test_chain.rs | |
parent | 2b95745e709cfb52a81074e4882d0a2cbaaea2ed (diff) | |
download | bytes-49f37ac424d7df1f8ee1989d8f3b5ceb6b6a9ea0.tar.gz |
Upgrade rust/crates/bytes to 1.0.1
Test: make
Change-Id: Ie9751d0251a3844858395badc8546303dcddeb24
Diffstat (limited to 'tests/test_chain.rs')
-rw-r--r-- | tests/test_chain.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_chain.rs b/tests/test_chain.rs index 6dbc45d..500ccd4 100644 --- a/tests/test_chain.rs +++ b/tests/test_chain.rs @@ -1,6 +1,5 @@ #![warn(rust_2018_idioms)] -use bytes::buf::{BufExt, BufMutExt}; use bytes::{Buf, BufMut, Bytes}; #[cfg(feature = "std")] use std::io::IoSlice; @@ -10,7 +9,7 @@ fn collect_two_bufs() { let a = Bytes::from(&b"hello"[..]); let b = Bytes::from(&b"world"[..]); - let res = a.chain(b).to_bytes(); + let res = a.chain(b).copy_to_bytes(10); assert_eq!(res, &b"helloworld"[..]); } @@ -63,7 +62,7 @@ fn vectored_read() { IoSlice::new(b4), ]; - assert_eq!(2, buf.bytes_vectored(&mut iovecs)); + assert_eq!(2, buf.chunks_vectored(&mut iovecs)); assert_eq!(iovecs[0][..], b"hello"[..]); assert_eq!(iovecs[1][..], b"world"[..]); assert_eq!(iovecs[2][..], b""[..]); @@ -84,7 +83,7 @@ fn vectored_read() { IoSlice::new(b4), ]; - assert_eq!(2, buf.bytes_vectored(&mut iovecs)); + assert_eq!(2, buf.chunks_vectored(&mut iovecs)); assert_eq!(iovecs[0][..], b"llo"[..]); assert_eq!(iovecs[1][..], b"world"[..]); assert_eq!(iovecs[2][..], b""[..]); @@ -105,7 +104,7 @@ fn vectored_read() { IoSlice::new(b4), ]; - assert_eq!(1, buf.bytes_vectored(&mut iovecs)); + assert_eq!(1, buf.chunks_vectored(&mut iovecs)); assert_eq!(iovecs[0][..], b"world"[..]); assert_eq!(iovecs[1][..], b""[..]); assert_eq!(iovecs[2][..], b""[..]); @@ -126,7 +125,7 @@ fn vectored_read() { IoSlice::new(b4), ]; - assert_eq!(1, buf.bytes_vectored(&mut iovecs)); + assert_eq!(1, buf.chunks_vectored(&mut iovecs)); assert_eq!(iovecs[0][..], b"ld"[..]); assert_eq!(iovecs[1][..], b""[..]); assert_eq!(iovecs[2][..], b""[..]); |