diff options
author | 2019-08-16 08:50:24 +0200 | |
---|---|---|
committer | 2019-08-27 22:17:26 +0200 | |
commit | ae9991f3ba4f08d9c3d57b240a3c018082a38012 (patch) | |
tree | 9597dfe493c16922d95afdc364c543c626fbf469 /tests/test_bytes.rs | |
parent | b6cb346adfaae89bce44bfa337652e6d218d38c4 (diff) | |
download | bytes-ae9991f3ba4f08d9c3d57b240a3c018082a38012.tar.gz bytes-ae9991f3ba4f08d9c3d57b240a3c018082a38012.tar.zst bytes-ae9991f3ba4f08d9c3d57b240a3c018082a38012.zip |
Make From only for static slices to Bytes
Diffstat (limited to 'tests/test_bytes.rs')
-rw-r--r-- | tests/test_bytes.rs | 4 |
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); |