mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-26 00:00:20 +02:00
Remove io::Cursor, and implement Buf/BufMut for slices instead (#261)
This commit is contained in:
committed by
Carl Lerche
parent
d8134903de
commit
55aa530dc1
+10
-10
@@ -25,9 +25,9 @@ impl<T> Take<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use bytes::{Buf, BufMut, Bytes};
|
||||
/// use bytes::{Buf, BufMut};
|
||||
///
|
||||
/// let mut buf = Bytes::from_static(b"hello world").take(2);
|
||||
/// let mut buf = b"hello world".take(2);
|
||||
/// let mut dst = vec![];
|
||||
///
|
||||
/// dst.put(&mut buf);
|
||||
@@ -50,9 +50,9 @@ impl<T> Take<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use bytes::{Buf, BufMut, Bytes};
|
||||
/// use bytes::{Buf, BufMut};
|
||||
///
|
||||
/// let mut buf = Bytes::from_static(b"hello world").take(2);
|
||||
/// let mut buf = b"hello world".take(2);
|
||||
///
|
||||
/// assert_eq!(11, buf.get_ref().remaining());
|
||||
/// ```
|
||||
@@ -67,9 +67,9 @@ impl<T> Take<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use bytes::{Buf, BufMut, Bytes};
|
||||
/// use bytes::{Buf, BufMut};
|
||||
///
|
||||
/// let mut buf = Bytes::from_static(b"hello world").take(2);
|
||||
/// let mut buf = b"hello world".take(2);
|
||||
/// let mut dst = vec![];
|
||||
///
|
||||
/// buf.get_mut().advance(2);
|
||||
@@ -91,9 +91,9 @@ impl<T> Take<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use bytes::{Buf, Bytes};
|
||||
/// use bytes::Buf;
|
||||
///
|
||||
/// let mut buf = Bytes::from_static(b"hello world").take(2);
|
||||
/// let mut buf = b"hello world".take(2);
|
||||
///
|
||||
/// assert_eq!(2, buf.limit());
|
||||
/// assert_eq!(b'h', buf.get_u8());
|
||||
@@ -113,9 +113,9 @@ impl<T> Take<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use bytes::{Buf, BufMut, Bytes};
|
||||
/// use bytes::{Buf, BufMut};
|
||||
///
|
||||
/// let mut buf = Bytes::from_static(b"hello world").take(2);
|
||||
/// let mut buf = b"hello world".take(2);
|
||||
/// let mut dst = vec![];
|
||||
///
|
||||
/// dst.put(&mut buf);
|
||||
|
||||
Reference in New Issue
Block a user