From e158160418308d0102bc6c6d5984710c7f14e0d7 Mon Sep 17 00:00:00 2001 From: jaystrictor <jay.strict@posteo.de> Date: Fri, 14 Apr 2017 18:06:58 +0200 Subject: [PATCH] Remove calls to deprecated drain* methods from docs (#102) --- src/bytes.rs | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bytes.rs b/src/bytes.rs index edc2e3a..3ea3c99 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -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); diff --git a/src/lib.rs b/src/lib.rs index 42c2c8c..f4bb087 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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); -- GitLab