Skip to content

Commit 74b04c7

Browse files
authored
Mark BytesMut::extend_from_slice as inline (#595)
This function can be hot in applications that do a lot of encoding. Ideally would do the same for `<BytesMut as BufMut>::put_slice` and `<BytesMut as BufMut::put_u8`.
1 parent 21ed332 commit 74b04c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bytes_mut.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ impl BytesMut {
761761
///
762762
/// assert_eq!(b"aaabbbcccddd", &buf[..]);
763763
/// ```
764+
#[inline]
764765
pub fn extend_from_slice(&mut self, extend: &[u8]) {
765766
let cnt = extend.len();
766767
self.reserve(cnt);

0 commit comments

Comments
 (0)