aboutsummaryrefslogtreecommitdiff
path: root/tests/test_bytes.rs
diff options
context:
space:
mode:
authorGravatar Sean McArthur <sean@seanmonstar.com> 2019-10-16 11:28:50 -0700
committerGravatar Carl Lerche <me@carllerche.com> 2019-10-16 11:28:50 -0700
commit491ebbf79a61f78b699e082d2793e79bb17f3f2e (patch)
treeef82ad3ebfafd5501f37f57081c3425dadc243fb /tests/test_bytes.rs
parent43ac8e5494e9404327f971937edb092b8cae6a2b (diff)
downloadbytes-491ebbf79a61f78b699e082d2793e79bb17f3f2e.tar.gz
bytes-491ebbf79a61f78b699e082d2793e79bb17f3f2e.tar.zst
bytes-491ebbf79a61f78b699e082d2793e79bb17f3f2e.zip
Remove Buf impl for &str (#301)
A `&str` cannot arbitrarily advance bytes, since it will panic if advanced to the middle of a Unicode segment.
Diffstat (limited to 'tests/test_bytes.rs')
-rw-r--r--tests/test_bytes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 6b3be59..212189e 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -402,7 +402,7 @@ fn reserve_vec_recycling() {
let mut bytes = BytesMut::with_capacity(16);
assert_eq!(bytes.capacity(), 16);
let addr = bytes.as_ptr() as usize;
- bytes.put("0123456789012345");
+ bytes.put("0123456789012345".as_bytes());
assert_eq!(bytes.as_ptr() as usize, addr);
bytes.advance(10);
assert_eq!(bytes.capacity(), 6);