mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +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");
|
||||
/// ```
|
||||
#[inline]
|
||||
pub unsafe fn set_len(&mut self, len: usize) {
|
||||
debug_assert!(len <= self.cap, "set_len out of bounds");
|
||||
self.len = len;
|
||||
|
||||
Reference in New Issue
Block a user