diff options
author | 2019-10-16 11:28:50 -0700 | |
---|---|---|
committer | 2019-10-16 11:28:50 -0700 | |
commit | 491ebbf79a61f78b699e082d2793e79bb17f3f2e (patch) | |
tree | ef82ad3ebfafd5501f37f57081c3425dadc243fb /tests/test_bytes.rs | |
parent | 43ac8e5494e9404327f971937edb092b8cae6a2b (diff) | |
download | bytes-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.rs | 2 |
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); |