Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/refcount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl RefCount {
#[inline]
pub fn safe_inc(&self) -> bool {
self.strong
.fetch_update(AcqRel, Acquire, |prev| (prev != 0).then(|| prev + 1))
.fetch_update(AcqRel, Acquire, |prev| (prev != 0).then_some(prev + 1))
.is_ok()
}

Expand Down
4 changes: 2 additions & 2 deletions vm/src/object/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct PyObjVTable {
debug: unsafe fn(&PyObject, &mut fmt::Formatter) -> fmt::Result,
}
unsafe fn drop_dealloc_obj<T: PyObjectPayload>(x: *mut PyObject) {
Box::from_raw(x as *mut PyInner<T>);
drop(Box::from_raw(x as *mut PyInner<T>));
}
unsafe fn debug_obj<T: PyObjectPayload>(x: &PyObject, f: &mut fmt::Formatter) -> fmt::Result {
let x = &*(x as *const PyObject as *const PyInner<T>);
Expand Down Expand Up @@ -269,7 +269,7 @@ impl WeakRefList {
}

unsafe fn dealloc(ptr: NonNull<PyMutex<WeakListInner>>) {
Box::from_raw(ptr.as_ptr());
drop(Box::from_raw(ptr.as_ptr()));
}

fn get_weak_references(&self) -> Vec<PyRef<PyWeak>> {
Expand Down