refactor[std]: do not use box syntax

This commit is contained in:
joboet
2023-01-17 14:08:35 +01:00
parent 159ba8a92c
commit 7f2cf19191
9 changed files with 35 additions and 59 deletions

View File

@@ -1110,8 +1110,7 @@ pub mod os {
let ptr = if ptr.is_null() {
// If the lookup returned null, we haven't initialized our own
// local copy, so do that now.
let ptr: Box<Value<T>> = box Value { inner: LazyKeyInner::new(), key: self };
let ptr = Box::into_raw(ptr);
let ptr = Box::into_raw(Box::new(Value { inner: LazyKeyInner::new(), key: self }));
// SAFETY: At this point we are sure there is no value inside
// ptr so setting it will not affect anyone else.
unsafe {