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`.
This commit is contained in:
Paa Kojo Samanpa
2023-02-04 20:16:41 +01:00
committed by GitHub
parent 21ed332836
commit 74b04c7aae
+1
View File
@@ -761,6 +761,7 @@ impl BytesMut {
///
/// assert_eq!(b"aaabbbcccddd", &buf[..]);
/// ```
#[inline]
pub fn extend_from_slice(&mut self, extend: &[u8]) {
let cnt = extend.len();
self.reserve(cnt);