aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Noah <33094578+coolreader18@users.noreply.github.com> 2021-04-10 15:49:33 -0500
committerGravatar GitHub <noreply@github.com> 2021-04-11 05:49:33 +0900
commit9c770188fdd0029d10bf21d7805f2ff0158c09bb (patch)
tree2a798976fa4282d553f4d02c6899ddcb39d7fcc1 /src
parentb9eade12a57b923a54376762ae908da1cff6bcd4 (diff)
downloadbytes-9c770188fdd0029d10bf21d7805f2ff0158c09bb.tar.gz
bytes-9c770188fdd0029d10bf21d7805f2ff0158c09bb.tar.zst
bytes-9c770188fdd0029d10bf21d7805f2ff0158c09bb.zip
Fully inline BytesMut::new (#493)
Diffstat (limited to 'src')
-rw-r--r--src/bytes_mut.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 61c0460..2af58e3 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -1250,6 +1250,7 @@ impl Shared {
}
}
+#[inline]
fn original_capacity_to_repr(cap: usize) -> usize {
let width = PTR_WIDTH - ((cap >> MIN_ORIGINAL_CAPACITY_WIDTH).leading_zeros() as usize);
cmp::min(
@@ -1476,6 +1477,7 @@ impl PartialEq<Bytes> for BytesMut {
}
}
+#[inline]
fn vptr(ptr: *mut u8) -> NonNull<u8> {
if cfg!(debug_assertions) {
NonNull::new(ptr).expect("Vec pointer should be non-null")