Fix new clippy warnings in Rust 1.63.0

This commit is contained in:
messense 2022-08-12 11:50:23 +08:00
parent 6eb47c2fce
commit db177a07ad
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
4 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ use pyo3::{py_run, wrap_pyfunction};
mod common;
#[pyclass]
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum MyEnum {
Variant,
OtherVariant,
@ -163,7 +163,7 @@ fn test_repr_parse() {
}
#[pyclass(name = "MyEnum")]
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum RenameEnum {
Variant,
}
@ -177,7 +177,7 @@ fn test_rename_enum_repr_correct() {
}
#[pyclass]
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum RenameVariantEnum {
#[pyo3(name = "VARIANT")]
Variant,

View File

@ -532,7 +532,7 @@ fn test_from_py_with_tuple_struct_error() {
});
}
#[derive(Debug, FromPyObject, PartialEq)]
#[derive(Debug, FromPyObject, PartialEq, Eq)]
pub enum ZapEnum {
Zip(#[pyo3(from_py_with = "PyAny::len")] usize),
Zap(String, #[pyo3(from_py_with = "PyAny::len")] usize),
@ -552,7 +552,7 @@ fn test_from_py_with_enum() {
});
}
#[derive(Debug, FromPyObject, PartialEq)]
#[derive(Debug, FromPyObject, PartialEq, Eq)]
#[pyo3(transparent)]
pub struct TransparentFromPyWith {
#[pyo3(from_py_with = "PyAny::len")]

View File

@ -176,7 +176,7 @@ fn inheritance_with_new_methods_with_drop() {
let typeobj = py.get_type::<SubClassWithDrop>();
let inst = typeobj.call((), None).unwrap();
let obj: &PyCell<SubClassWithDrop> = PyTryInto::try_into(&*inst).unwrap();
let obj: &PyCell<SubClassWithDrop> = PyTryInto::try_into(inst).unwrap();
let mut obj_ref_mut = obj.borrow_mut();
obj_ref_mut.data = Some(Arc::clone(&drop_called1));
let base: &mut BaseClassWithDrop = obj_ref_mut.as_mut();

View File

@ -195,7 +195,7 @@ fn inheritance_with_new_methods_with_drop() {
let typeobj = py.get_type::<SubClassWithDrop>();
let inst = typeobj.call((), None).unwrap();
let obj: &PyCell<SubClassWithDrop> = PyTryInto::try_into(&*inst).unwrap();
let obj: &PyCell<SubClassWithDrop> = PyTryInto::try_into(inst).unwrap();
let mut obj_ref_mut = obj.borrow_mut();
obj_ref_mut.data = Some(Arc::clone(&drop_called1));
let base: &mut BaseClassWithDrop = obj_ref_mut.as_mut();