mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-10 00:00:09 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user