mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Remove calls to deprecated drain* methods from docs (#102)
This commit is contained in:
+1
-1
@@ -1111,7 +1111,7 @@ impl BytesMut {
|
||||
/// buf.put(&[0; 64][..]);
|
||||
///
|
||||
/// let ptr = buf.as_ptr();
|
||||
/// let other = buf.drain();
|
||||
/// let other = buf.take();
|
||||
///
|
||||
/// assert!(buf.is_empty());
|
||||
/// assert_eq!(buf.capacity(), 64);
|
||||
|
||||
+2
-2
@@ -29,12 +29,12 @@
|
||||
//! buf.put(&b"hello world"[..]);
|
||||
//! buf.put_u16::<BigEndian>(1234);
|
||||
//!
|
||||
//! let a = buf.drain();
|
||||
//! let a = buf.take();
|
||||
//! assert_eq!(a, b"hello world\x04\xD2"[..]);
|
||||
//!
|
||||
//! buf.put(&b"goodbye world"[..]);
|
||||
//!
|
||||
//! let b = buf.drain();
|
||||
//! let b = buf.take();
|
||||
//! assert_eq!(b, b"goodbye world"[..]);
|
||||
//!
|
||||
//! assert_eq!(buf.capacity(), 998);
|
||||
|
||||
Reference in New Issue
Block a user