Skip to content
Snippets Groups Projects
Unverified Commit 73426dfa authored by Taiki Endo's avatar Taiki Endo Committed by GitHub
Browse files

Fix one use of MaybeUninit (#291)

parent 425432ba
No related branches found
No related tags found
No related merge requests found
......@@ -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<Inner> = 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`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment