mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
Improve BytesMut::split suggestion (#699)
This commit is contained in:
+1
-1
@@ -349,7 +349,7 @@ impl BytesMut {
|
|||||||
///
|
///
|
||||||
/// assert_eq!(other, b"hello world"[..]);
|
/// assert_eq!(other, b"hello world"[..]);
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use = "consider BytesMut::advance(len()) if you don't need the other half"]
|
#[must_use = "consider BytesMut::clear if you don't need the other half"]
|
||||||
pub fn split(&mut self) -> BytesMut {
|
pub fn split(&mut self) -> BytesMut {
|
||||||
let len = self.len();
|
let len = self.len();
|
||||||
self.split_to(len)
|
self.split_to(len)
|
||||||
|
|||||||
Reference in New Issue
Block a user