Add inline attribute to BytesMut::set_len (#408)

This commit is contained in:
Juan Aguilar
2020-07-03 16:47:32 -07:00
committed by GitHub
parent 5cde647c29
commit 3603cec7c2
+1
View File
@@ -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;