aboutsummaryrefslogtreecommitdiff
path: root/src/buf/buf_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/buf/buf_impl.rs')
-rw-r--r--src/buf/buf_impl.rs21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/buf/buf_impl.rs b/src/buf/buf_impl.rs
index b9e9141..48f8d12 100644
--- a/src/buf/buf_impl.rs
+++ b/src/buf/buf_impl.rs
@@ -903,9 +903,9 @@ pub trait Buf {
/// # Examples
///
/// ```
- /// use bytes::{Buf};
+ /// use bytes::Buf;
///
- /// let bytes = "hello world".to_bytes();
+ /// let bytes = (&b"hello world"[..]).to_bytes();
/// assert_eq!(&bytes[..], &b"hello world"[..]);
/// ```
fn to_bytes(&mut self) -> crate::Bytes {
@@ -971,23 +971,6 @@ impl Buf for &[u8] {
}
}
-impl Buf for &str {
- #[inline]
- fn remaining(&self) -> usize {
- self.len()
- }
-
- #[inline]
- fn bytes(&self) -> &[u8] {
- self.as_bytes()
- }
-
- #[inline]
- fn advance(&mut self, cnt: usize) {
- *self = &self[cnt..];
- }
-}
-
impl Buf for Option<[u8; 1]> {
fn remaining(&self) -> usize {
if self.is_some() {