diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index 24e8a76401f..8fde0412971 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -69,7 +69,7 @@ pub fn target_triple_from_env() -> Triple { /// /// When the `PYO3_NO_PYTHON` variable is set, or during cross compile situations, then alternative /// strategies are used to populate this type. -#[cfg_attr(test, derive(Debug, PartialEq))] +#[cfg_attr(test, derive(Debug, PartialEq, Eq))] pub struct InterpreterConfig { /// The Python implementation flavor. /// @@ -634,7 +634,7 @@ impl FromStr for PythonVersion { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum PythonImplementation { CPython, PyPy, @@ -742,7 +742,7 @@ fn require_libdir_for_target(target: &Triple) -> bool { /// /// Usually this is collected from the environment (i.e. `PYO3_CROSS_*` and `CARGO_CFG_TARGET_*`) /// when a cross-compilation configuration is detected. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct CrossCompileConfig { /// The directory containing the Python library to link against. pub lib_dir: Option, @@ -1036,7 +1036,7 @@ impl FromStr for BuildFlag { /// is the equivalent of `#ifdef {varname}` in C. /// /// see Misc/SpecialBuilds.txt in the python source for what these mean. -#[cfg_attr(test, derive(Debug, PartialEq))] +#[cfg_attr(test, derive(Debug, PartialEq, Eq))] #[derive(Clone, Default)] pub struct BuildFlags(pub HashSet); diff --git a/pyo3-macros-backend/src/attributes.rs b/pyo3-macros-backend/src/attributes.rs index 42efade0f34..901927430fb 100644 --- a/pyo3-macros-backend/src/attributes.rs +++ b/pyo3-macros-backend/src/attributes.rs @@ -40,7 +40,7 @@ pub struct KeywordAttribute { /// A helper type which parses the inner type via a literal string /// e.g. LitStrValue -> parses "some::path" in quotes. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct LitStrValue(pub T); impl Parse for LitStrValue { @@ -57,7 +57,7 @@ impl ToTokens for LitStrValue { } /// A helper type which parses a name via a literal string -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct NameLitStr(pub Ident); impl Parse for NameLitStr { diff --git a/pyo3-macros-backend/src/pyfunction.rs b/pyo3-macros-backend/src/pyfunction.rs index f3138e943e0..c97495b1b55 100644 --- a/pyo3-macros-backend/src/pyfunction.rs +++ b/pyo3-macros-backend/src/pyfunction.rs @@ -21,7 +21,7 @@ use syn::{ token::Comma, }; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Argument { PosOnlyArgsSeparator, VarArgsSeparator, diff --git a/src/pycell.rs b/src/pycell.rs index b42cbe37a24..11f05eb5018 100644 --- a/src/pycell.rs +++ b/src/pycell.rs @@ -964,7 +964,7 @@ impl<'a, T: PyClass> std::convert::TryFrom<&'a PyCell> impl + fmt::Debug> fmt::Debug for PyRefMut<'_, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Debug::fmt(&*(self.deref()), f) + fmt::Debug::fmt(self.deref(), f) } } diff --git a/src/types/string.rs b/src/types/string.rs index d195f1d2c58..1cd7a1499a6 100644 --- a/src/types/string.rs +++ b/src/types/string.rs @@ -16,7 +16,7 @@ use std::str; /// Python internally stores strings in various representations. This enumeration /// represents those variations. #[cfg(all(not(Py_LIMITED_API), target_endian = "little"))] -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum PyStringData<'a> { /// UCS1 representation. Ucs1(&'a [u8]),