aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_bytes.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 3c51ac5..7334523 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -528,7 +528,7 @@ fn stress() {
for i in 0..ITERS {
let data = [i as u8; 256];
- let buf = Arc::new(Bytes::from(&data[..]));
+ let buf = Arc::new(Bytes::copy_from_slice(&data[..]));
let barrier = Arc::new(Barrier::new(THREADS));
let mut joins = Vec::with_capacity(THREADS);
@@ -888,7 +888,7 @@ fn slice_ref_catches_not_an_empty_subset() {
#[test]
#[should_panic]
fn empty_slice_ref_catches_not_an_empty_subset() {
- let bytes = Bytes::from(&b""[..]);
+ let bytes = Bytes::copy_from_slice(&b""[..]);
let slice = &b""[0..0];
bytes.slice_ref(slice);