clippy: fix some warnings from beta toolchain

This commit is contained in:
David Hewitt 2022-07-12 23:01:38 +01:00
parent a95485cd0e
commit c4a2c6c912
5 changed files with 9 additions and 9 deletions

View File

@ -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<PathBuf>,
@ -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<BuildFlag>);

View File

@ -40,7 +40,7 @@ pub struct KeywordAttribute<K, V> {
/// A helper type which parses the inner type via a literal string
/// e.g. LitStrValue<Path> -> parses "some::path" in quotes.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct LitStrValue<T>(pub T);
impl<T: Parse> Parse for LitStrValue<T> {
@ -57,7 +57,7 @@ impl<T: ToTokens> ToTokens for LitStrValue<T> {
}
/// 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 {

View File

@ -21,7 +21,7 @@ use syn::{
token::Comma,
};
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Argument {
PosOnlyArgsSeparator,
VarArgsSeparator,

View File

@ -964,7 +964,7 @@ impl<'a, T: PyClass<Frozen = False>> std::convert::TryFrom<&'a PyCell<T>>
impl<T: PyClass<Frozen = False> + 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)
}
}

View File

@ -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]),