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.
This commit is contained in:
Sean McArthur
2019-10-16 11:28:50 -07:00
committed by Carl Lerche
parent 43ac8e5494
commit 491ebbf79a
4 changed files with 9 additions and 26 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ use crate::loom::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering};
///
/// buf.put_u8(b'h');
/// buf.put_u8(b'e');
/// buf.put("llo");
/// buf.put(&b"llo"[..]);
///
/// assert_eq!(&buf[..], b"hello");
///
@@ -219,7 +219,7 @@ impl BytesMut {
/// use std::thread;
///
/// let mut b = BytesMut::with_capacity(64);
/// b.put("hello world");
/// b.put(&b"hello world"[..]);
/// let b1 = b.freeze();
/// let b2 = b1.clone();
///