Skip to content

Commit e9b8ee3

Browse files
committed
fix(cardano-blockchain-types): redundant code
1 parent 519c415 commit e9b8ee3

File tree

1 file changed

+1
-16
lines changed
  • rust/cardano-blockchain-types/src

1 file changed

+1
-16
lines changed

rust/cardano-blockchain-types/src/point.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -363,22 +363,7 @@ impl PartialEq<Option<Hash<32>>> for Point {
363363
/// provided hash is `None`, the function checks if the `Point` has an
364364
/// empty hash.
365365
fn eq(&self, other: &Option<Hash<32>>) -> bool {
366-
match other {
367-
Some(cmp_hash) => {
368-
match self.0 {
369-
pallas::network::miniprotocols::Point::Specific(_, ref hash) => {
370-
**hash == **cmp_hash
371-
},
372-
pallas::network::miniprotocols::Point::Origin => false,
373-
}
374-
},
375-
None => {
376-
match self.0 {
377-
pallas::network::miniprotocols::Point::Specific(_, ref hash) => hash.is_empty(),
378-
pallas::network::miniprotocols::Point::Origin => true,
379-
}
380-
},
381-
}
366+
*self == other.map(Blake2b256Hash::from)
382367
}
383368
}
384369

0 commit comments

Comments
 (0)