From ae9991f3ba4f08d9c3d57b240a3c018082a38012 Mon Sep 17 00:00:00 2001 From: Douman Date: Fri, 16 Aug 2019 08:50:24 +0200 Subject: Make From only for static slices to Bytes --- tests/test_bytes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_bytes.rs') 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); -- cgit v1.2.3