1
Fork 0

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:
Scott McMurray 2020-08-25 09:40:53 -07:00
parent c30341ddec
commit f3024073f9
3 changed files with 7 additions and 3 deletions

View file

@ -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
}