Suggest mem::forget
if mem::ManuallyDrop::new
isn't used
I think this communicates the intent better, and is shorter anyway.
This commit is contained in:
parent
c30341ddec
commit
f3024073f9
3 changed files with 7 additions and 3 deletions
|
@ -293,7 +293,7 @@ impl<T> SyncOnceCell<T> {
|
|||
|
||||
// Don't drop this `SyncOnceCell`. We just moved out one of the fields, but didn't set
|
||||
// the state to uninitialized.
|
||||
mem::ManuallyDrop::new(self);
|
||||
mem::forget(self);
|
||||
inner
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue