From b1b418b81a13ede548273665e83c1bc5a97dffcd Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 19 Sep 2022 10:25:03 +0200 Subject: chore: fix clippy warnings (#15944) Stop allowing clippy::derive-partial-eq-without-eq and fix warnings about deriving PartialEq without also deriving Eq. In one case I removed the PartialEq because it a) wasn't necessary, and b) sketchy because it was comparing floating point numbers. IMO, that's a good argument for enforcing the lint rule, because it would most likely have been caught during review if it had been enabled. --- ext/crypto/key.rs | 4 ++-- ext/crypto/shared.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/crypto') diff --git a/ext/crypto/key.rs b/ext/crypto/key.rs index da73d2191..b8f87189e 100644 --- a/ext/crypto/key.rs +++ b/ext/crypto/key.rs @@ -17,7 +17,7 @@ pub enum KeyType { Secret, } -#[derive(Serialize, Deserialize, Copy, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Copy, Clone, Eq, PartialEq)] pub enum CryptoHash { #[serde(rename = "SHA-1")] Sha1, @@ -98,7 +98,7 @@ impl hkdf::KeyType for HkdfOutput { } } -#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Copy, Clone, Debug, Eq, PartialEq)] #[serde(rename_all = "camelCase")] pub enum KeyUsage { Encrypt, diff --git a/ext/crypto/shared.rs b/ext/crypto/shared.rs index 51fed6509..dec9c6d4a 100644 --- a/ext/crypto/shared.rs +++ b/ext/crypto/shared.rs @@ -46,7 +46,7 @@ pub const ID_SECP384R1_OID: const_oid::ObjectIdentifier = pub const ID_SECP521R1_OID: const_oid::ObjectIdentifier = const_oid::ObjectIdentifier::new_unwrap("1.3.132.0.35"); -#[derive(Serialize, Deserialize, Copy, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Copy, Clone, Eq, PartialEq)] pub enum ShaHash { #[serde(rename = "SHA-1")] Sha1, @@ -58,7 +58,7 @@ pub enum ShaHash { Sha512, } -#[derive(Serialize, Deserialize, Copy, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Copy, Clone, Eq, PartialEq)] pub enum EcNamedCurve { #[serde(rename = "P-256")] P256, -- cgit v1.2.3