From 356d13e46575bb4d7be2cc308cf324cdcf0f0b33 Mon Sep 17 00:00:00 2001 From: Aleksei Date: Mon, 20 Aug 2018 12:10:21 +0300 Subject: [PATCH] Add some useful standard trait implementations --- src/network/constants.rs | 2 +- src/util/address.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/constants.rs b/src/network/constants.rs index 08bd0212..78b31f2e 100644 --- a/src/network/constants.rs +++ b/src/network/constants.rs @@ -49,7 +49,7 @@ pub const USER_AGENT: &'static str = "bitcoin-rust v0.1"; user_enum! { /// The cryptocurrency to act on - #[derive(Copy, PartialEq, Eq, Clone, Hash)] + #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Clone, Hash)] pub enum Network { /// Classic Bitcoin Bitcoin <-> "bitcoin", diff --git a/src/util/address.rs b/src/util/address.rs index 3173cba4..1d2cee45 100644 --- a/src/util/address.rs +++ b/src/util/address.rs @@ -30,7 +30,7 @@ use util::base58; use util::Error; /// The method used to produce an address -#[derive(Clone, PartialEq, Debug)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Payload { /// pay-to-pubkey Pubkey(PublicKey), @@ -42,7 +42,7 @@ pub enum Payload { WitnessProgram(WitnessProgram), } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] /// A Bitcoin address pub struct Address { /// The type of the address