diff --git a/src/bytes.rs b/src/bytes.rs index 6282cf4..1d5583b 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -2176,19 +2176,18 @@ impl Inner { if self.is_inline_or_static() { // In this case, a shallow_clone still involves copying the data. - let mut inner: Inner = mem::MaybeUninit::uninit().assume_init(); + let mut inner: mem::MaybeUninit = mem::MaybeUninit::uninit(); ptr::copy_nonoverlapping( self, - &mut inner, + inner.as_mut_ptr(), 1, ); - inner + inner.assume_init() } else { self.shallow_clone_sync(mut_self) } } - #[cold] unsafe fn shallow_clone_sync(&self, mut_self: bool) -> Inner { // The function requires `&self`, this means that `shallow_clone`