From 7abd6b0bb3c1dc88adc246ae06c00067dabb4657 Mon Sep 17 00:00:00 2001 From: Aleksey Sidorov Date: Thu, 17 May 2018 17:47:53 +0300 Subject: [PATCH 1/2] More useful derives Derive standard traits to make bech32 usable in the keys of `BTreeMap` and `HashMap` collections. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1070d7840..1db25aa2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,7 @@ use std::str::FromStr; use std::fmt::{Display, Formatter}; /// Integer in the range `0..32` -#[derive(PartialEq, Eq, Debug, Copy, Clone, Default, PartialOrd, Ord)] +#[derive(PartialEq, Eq, Debug, Copy, Clone, Default, PartialOrd, Ord, Hash)] #[allow(non_camel_case_types)] pub struct u5(u8); @@ -99,7 +99,7 @@ pub trait CheckBase32> { /// Grouping structure for the human-readable part and the data part /// of decoded Bech32 string. -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Eq, Debug, Clone, PartialOrd, Ord, Hash)] pub struct Bech32 { /// Human-readable part hrp: String, From 300af4e3423067285271aa990ac6fceb3bf9532a Mon Sep 17 00:00:00 2001 From: Aleksey Sidorov Date: Thu, 17 May 2018 18:56:07 +0300 Subject: [PATCH 2/2] Bump crate version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c8332a475..45caf3c4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bech32" -version = "0.4.0" +version = "0.4.1" authors = ["Clark Moody"] repository = "https://github.com/rust-bitcoin/rust-bech32" description = "Encodes and decodes the Bech32 format"