Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

Commit c2ff344

Browse files
authored
Manual implementation of Eq (#29)
1 parent e0c93e6 commit c2ff344

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ const MAX_ENR_SIZE: usize = 300;
215215
/// The ENR, allowing for arbitrary signing algorithms.
216216
///
217217
/// This struct will always have a valid signature, known public key type, sequence number and `NodeId`. All other parameters are variable/optional.
218-
#[derive(Eq)]
219218
pub struct Enr<K: EnrKey> {
220219
/// ENR sequence number.
221220
seq: u64,
@@ -763,12 +762,11 @@ impl<K: EnrKey> Clone for Enr<K> {
763762
}
764763
}
765764

765+
impl<K: EnrKey> std::cmp::Eq for Enr<K> {}
766+
766767
impl<K: EnrKey> PartialEq for Enr<K> {
767768
fn eq(&self, other: &Self) -> bool {
768-
self.seq == other.seq
769-
&& self.node_id == other.node_id
770-
&& self.content == other.content
771-
&& self.signature == other.signature
769+
self.seq == other.seq && self.node_id == other.node_id && self.signature == other.signature
772770
}
773771
}
774772

0 commit comments

Comments
 (0)