Procházet zdrojové kódy

derive PartialEq for Coin and Nullifier

ghassmo před 4 roky
rodič
revize
49b363028a
2 změnil soubory, kde provedl 2 přidání a 12 odebrání
  1. 1 6
      src/crypto/coin.rs
  2. 1 6
      src/crypto/nullifier.rs

+ 1 - 6
src/crypto/coin.rs

@@ -5,7 +5,7 @@ use crate::{
     serial::{Decodable, Encodable},
 };
 
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 pub struct Coin {
     pub repr: [u8; 32],
 }
@@ -30,8 +30,3 @@ impl Decodable for Coin {
     }
 }
 
-impl PartialEq for Coin {
-    fn eq(&self, other: &Self) -> bool {
-        self.repr == other.repr
-    }
-}

+ 1 - 6
src/crypto/nullifier.rs

@@ -6,7 +6,7 @@ use crate::{
 };
 
 
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq)]
 pub struct Nullifier {
     pub repr: [u8; 32],
 }
@@ -31,8 +31,3 @@ impl Decodable for Nullifier {
     }
 }
 
-impl PartialEq for Nullifier {
-    fn eq(&self, other: &Self) -> bool {
-        self.repr == other.repr
-    }
-}