Просмотр исходного кода

derive PartialEq for Coin and Nullifier

ghassmo 4 лет назад
Родитель
Сommit
49b363028a
2 измененных файлов с 2 добавлено и 12 удалено
  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},
     serial::{Decodable, Encodable},
 };
 };
 
 
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 pub struct Coin {
 pub struct Coin {
     pub repr: [u8; 32],
     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 struct Nullifier {
     pub repr: [u8; 32],
     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
-    }
-}