Skip to content

Commit 2efe22e

Browse files
authored
Merge pull request RustPython#4182 from fanninpm/clippy-1.64
Fix compilation and clippy issues (Rust 1.64)
2 parents 34e09a8 + 50fd23a commit 2efe22e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/src/refcount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl RefCount {
4444
#[inline]
4545
pub fn safe_inc(&self) -> bool {
4646
self.strong
47-
.fetch_update(AcqRel, Acquire, |prev| (prev != 0).then(|| prev + 1))
47+
.fetch_update(AcqRel, Acquire, |prev| (prev != 0).then_some(prev + 1))
4848
.is_ok()
4949
}
5050

vm/src/object/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct PyObjVTable {
7878
debug: unsafe fn(&PyObject, &mut fmt::Formatter) -> fmt::Result,
7979
}
8080
unsafe fn drop_dealloc_obj<T: PyObjectPayload>(x: *mut PyObject) {
81-
Box::from_raw(x as *mut PyInner<T>);
81+
drop(Box::from_raw(x as *mut PyInner<T>));
8282
}
8383
unsafe fn debug_obj<T: PyObjectPayload>(x: &PyObject, f: &mut fmt::Formatter) -> fmt::Result {
8484
let x = &*(x as *const PyObject as *const PyInner<T>);
@@ -269,7 +269,7 @@ impl WeakRefList {
269269
}
270270

271271
unsafe fn dealloc(ptr: NonNull<PyMutex<WeakListInner>>) {
272-
Box::from_raw(ptr.as_ptr());
272+
drop(Box::from_raw(ptr.as_ptr()));
273273
}
274274

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

0 commit comments

Comments
 (0)