Skip to content

Commit ccc80cf

Browse files
committed
Rely on const generic big arrays for PartialEq in msgs
Implementation of standard traits on arrays longer than 32 elements was shipped in rustc 1.47, which is below our MSRV of 1.48 and we can use to remove some unnecessary manual implementation of `PartialEq` on `OnionPacket`.
1 parent a025c7c commit ccc80cf

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

lightning/src/ln/msgs.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,18 +1703,6 @@ impl onion_utils::Packet for OnionPacket {
17031703
}
17041704
}
17051705

1706-
impl Eq for OnionPacket { }
1707-
impl PartialEq for OnionPacket {
1708-
fn eq(&self, other: &OnionPacket) -> bool {
1709-
for (i, j) in self.hop_data.iter().zip(other.hop_data.iter()) {
1710-
if i != j { return false; }
1711-
}
1712-
self.version == other.version &&
1713-
self.public_key == other.public_key &&
1714-
self.hmac == other.hmac
1715-
}
1716-
}
1717-
17181706
impl fmt::Debug for OnionPacket {
17191707
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17201708
f.write_fmt(format_args!("OnionPacket version {} with hmac {:?}", self.version, &self.hmac[..]))

0 commit comments

Comments
 (0)