aboutsummaryrefslogtreecommitdiff
path: root/src/buf/iter.rs
diff options
context:
space:
mode:
authorGravatar Douman <douman@gmx.se> 2019-08-27 22:09:43 +0200
committerGravatar Carl Lerche <me@carllerche.com> 2019-08-27 13:09:43 -0700
commitb6cb346adfaae89bce44bfa337652e6d218d38c4 (patch)
tree0e6cb36b1db4ece480554bce0f2f0ab307013931 /src/buf/iter.rs
parent79e4b2847f27137faaf149d116a352cbeae47fd1 (diff)
downloadbytes-b6cb346adfaae89bce44bfa337652e6d218d38c4.tar.gz
bytes-b6cb346adfaae89bce44bfa337652e6d218d38c4.tar.zst
bytes-b6cb346adfaae89bce44bfa337652e6d218d38c4.zip
Remove IntoBuf/FromBuf (#288)
As consequence Buf::collect is removed as well, which is replaced with `Buf::into_bytes`. The advantage of `Buf::into_bytes` is that it can be optimized in cases where converting a `T: Buf` into a `Bytes` instance is efficient.
Diffstat (limited to 'src/buf/iter.rs')
-rw-r--r--src/buf/iter.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/buf/iter.rs b/src/buf/iter.rs
index a1bf89b..a93e359 100644
--- a/src/buf/iter.rs
+++ b/src/buf/iter.rs
@@ -9,9 +9,9 @@ use crate::Buf;
/// Basic usage:
///
/// ```
-/// use bytes::{Buf, IntoBuf, Bytes};
+/// use bytes::{Buf, Bytes};
///
-/// let buf = Bytes::from(&b"abc"[..]).into_buf();
+/// let buf = Bytes::from(&b"abc"[..]);
/// let mut iter = buf.into_iter();
///
/// assert_eq!(iter.next(), Some(b'a'));
@@ -52,9 +52,9 @@ impl<T> IntoIter<T> {
/// # Examples
///
/// ```rust
- /// use bytes::{Buf, IntoBuf, Bytes};
+ /// use bytes::{Buf, Bytes};
///
- /// let buf = Bytes::from(&b"abc"[..]).into_buf();
+ /// let buf = Bytes::from(&b"abc"[..]);
/// let mut iter = buf.into_iter();
///
/// assert_eq!(iter.next(), Some(b'a'));
@@ -73,9 +73,9 @@ impl<T> IntoIter<T> {
/// # Examples
///
/// ```rust
- /// use bytes::{Buf, IntoBuf, Bytes};
+ /// use bytes::{Buf, Bytes};
///
- /// let buf = Bytes::from(&b"abc"[..]).into_buf();
+ /// let buf = Bytes::from(&b"abc"[..]);
/// let mut iter = buf.into_iter();
///
/// assert_eq!(iter.next(), Some(b'a'));
@@ -93,7 +93,7 @@ impl<T> IntoIter<T> {
/// # Examples
///
/// ```rust
- /// use bytes::{Buf, IntoBuf, BytesMut};
+ /// use bytes::{Buf, BytesMut};
///
/// let buf = BytesMut::from(&b"abc"[..]);
/// let mut iter = buf.into_iter();