aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Paa Kojo Samanpa <samanpa@gmail.com> 2023-02-04 14:16:41 -0500
committerGravatar GitHub <noreply@github.com> 2023-02-04 20:16:41 +0100
commit74b04c7aae5fd7e73f4283774eab0ef72a26a8a7 (patch)
treebdb6e6cf915af8131e3bd1cd891eb4ec46149d1a
parent21ed3328364716fa30a4bf7502c913bbf0a90f45 (diff)
downloadbytes-74b04c7aae5fd7e73f4283774eab0ef72a26a8a7.tar.gz
bytes-74b04c7aae5fd7e73f4283774eab0ef72a26a8a7.tar.zst
bytes-74b04c7aae5fd7e73f4283774eab0ef72a26a8a7.zip
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`.
-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 70613b2..450b932 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -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);