aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Juan Aguilar <mhpoin@gmail.com> 2020-07-03 23:47:32 +0000
committerGravatar GitHub <noreply@github.com> 2020-07-03 16:47:32 -0700
commit3603cec7c238a3414058e76d08ce9daa4a09d61c (patch)
tree9d9d99f668f62daa8a8eb3a464656e8b85453566 /src
parent5cde647c2982d0b59edaea8a74aa689b5dd03c52 (diff)
downloadbytes-3603cec7c238a3414058e76d08ce9daa4a09d61c.tar.gz
bytes-3603cec7c238a3414058e76d08ce9daa4a09d61c.tar.zst
bytes-3603cec7c238a3414058e76d08ce9daa4a09d61c.zip
Add inline attribute to BytesMut::set_len (#408)
Diffstat (limited to 'src')
-rw-r--r--src/bytes_mut.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 802745e..a49ae76 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -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;