Some more clippy warning fixes
[rustfix](https://github.com/killercup/rustfix) makes it much easier.
This commit is contained in:
parent
e69163344a
commit
5a8fd2febc
|
@ -151,7 +151,7 @@ fn impl_class(cls: &syn::Ident, base: &syn::Ident,
|
|||
<#cls as _pyo3::typeob::PyTypeObject>::init_type(
|
||||
_pyo3::Python::assume_gil_acquired());
|
||||
}
|
||||
std::mem::transmute(FREELIST)
|
||||
&mut *FREELIST
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ impl PyGetterDef {
|
|||
dst.name = CString::new(self.name).expect(
|
||||
"Method name must not contain NULL byte").into_raw();
|
||||
}
|
||||
dst.get = Some(self.meth.clone());
|
||||
dst.get = Some(self.meth);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ impl AsPyRef<PyObjectRef> for PyObject {
|
|||
}
|
||||
#[inline]
|
||||
fn as_mut(&self, _py: Python) -> &mut PyObjectRef {
|
||||
unsafe {std::mem::transmute(self as *const _ as *mut PyObjectRef)}
|
||||
unsafe {&mut *(self as *const _ as *mut PyObjectRef)}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ pub unsafe fn register_pointer(obj: *mut ffi::PyObject)
|
|||
|
||||
pub unsafe fn register_owned(_py: Python, obj: *mut ffi::PyObject) -> &PyObjectRef
|
||||
{
|
||||
let pool: &'static mut Pointers = mem::transmute(POINTERS);
|
||||
let pool: &'static mut Pointers = &mut *POINTERS;
|
||||
pool.owned.push(obj);
|
||||
mem::transmute(&pool.owned[pool.owned.len()-1])
|
||||
}
|
||||
|
|
|
@ -225,13 +225,13 @@ fn data_is_dropped() {
|
|||
member2: TestDropCall { drop_called: drop_called2.clone() },
|
||||
token: t
|
||||
}).unwrap();
|
||||
assert!(drop_called1.load(Ordering::Relaxed) == false);
|
||||
assert!(drop_called2.load(Ordering::Relaxed) == false);
|
||||
assert!(!drop_called1.load(Ordering::Relaxed));
|
||||
assert!(!drop_called2.load(Ordering::Relaxed));
|
||||
drop(inst);
|
||||
}
|
||||
|
||||
assert!(drop_called1.load(Ordering::Relaxed) == true);
|
||||
assert!(drop_called2.load(Ordering::Relaxed) == true);
|
||||
assert!(drop_called1.load(Ordering::Relaxed));
|
||||
assert!(drop_called2.load(Ordering::Relaxed));
|
||||
}
|
||||
|
||||
#[py::class]
|
||||
|
|
Loading…
Reference in New Issue