mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-25 00:00:22 +02:00
Add inline attribute to BytesMut::set_len (#408)
This commit is contained in:
@@ -475,6 +475,7 @@ impl BytesMut {
|
|||||||
///
|
///
|
||||||
/// assert_eq!(&b[..], b"hello world");
|
/// assert_eq!(&b[..], b"hello world");
|
||||||
/// ```
|
/// ```
|
||||||
|
#[inline]
|
||||||
pub unsafe fn set_len(&mut self, len: usize) {
|
pub unsafe fn set_len(&mut self, len: usize) {
|
||||||
debug_assert!(len <= self.cap, "set_len out of bounds");
|
debug_assert!(len <= self.cap, "set_len out of bounds");
|
||||||
self.len = len;
|
self.len = len;
|
||||||
|
|||||||
Reference in New Issue
Block a user