mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-24 00:00:14 +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[..]);
|
/// assert_eq!(b"aaabbbcccddd", &buf[..]);
|
||||||
/// ```
|
/// ```
|
||||||
|
#[inline]
|
||||||
pub fn extend_from_slice(&mut self, extend: &[u8]) {
|
pub fn extend_from_slice(&mut self, extend: &[u8]) {
|
||||||
let cnt = extend.len();
|
let cnt = extend.len();
|
||||||
self.reserve(cnt);
|
self.reserve(cnt);
|
||||||
|
|||||||
Reference in New Issue
Block a user