From 9c770188fdd0029d10bf21d7805f2ff0158c09bb Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Sat, 10 Apr 2021 15:49:33 -0500 Subject: [PATCH] Fully inline BytesMut::new (#493) --- src/bytes_mut.rs | 2 ++ 1 file changed, 2 insertions(+) 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 for BytesMut { } } +#[inline] fn vptr(ptr: *mut u8) -> NonNull { if cfg!(debug_assertions) { NonNull::new(ptr).expect("Vec pointer should be non-null")