From 613fdbeda669365a7413bc504ad02bbe3c786b1c Mon Sep 17 00:00:00 2001 From: Pawan Dhananjay Date: Mon, 11 Nov 2019 04:58:22 +0530 Subject: [PATCH] Derive `PartialEq` for Keypair (#595) * Derive `PartialEq` for Keypair * Silence clippy warning --- eth2/utils/bls/src/keypair.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/eth2/utils/bls/src/keypair.rs b/eth2/utils/bls/src/keypair.rs index 75960a47d..4a3b1e437 100644 --- a/eth2/utils/bls/src/keypair.rs +++ b/eth2/utils/bls/src/keypair.rs @@ -3,7 +3,7 @@ use serde_derive::{Deserialize, Serialize}; use std::fmt; use std::hash::{Hash, Hasher}; -#[derive(Debug, Clone, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Keypair { pub sk: SecretKey, pub pk: PublicKey, @@ -22,12 +22,7 @@ impl Keypair { } } -impl PartialEq for Keypair { - fn eq(&self, other: &Keypair) -> bool { - self == other - } -} - +#[allow(clippy::derive_hash_xor_eq)] impl Hash for Keypair { /// Note: this is distinct from consensus serialization, it will produce a different hash. ///