From 8342839e81f65e79a86b7cd4198ee8568690a056 Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 13 Aug 2018 15:27:45 +0200 Subject: [PATCH 1/3] Use uint --- Cargo.toml | 7 ++++--- src/lib.rs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3af19c6..7fcae40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,12 +6,13 @@ authors = ["Alexey Frolov "] license = "MIT" [dependencies] -bigint = "4" -rustc-hex = "1.0" +uint = { version = "0.3", path = "../parity-common/uint" } +# uint = "0.3" # NOT PUBLISHED YET +rustc-hex = { version = "2.0", default-features = false} serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } [features] default = ["std"] -std = ["bigint/std"] +std = ["uint/std"] serialize = ["serde", "serde_derive"] diff --git a/src/lib.rs b/src/lib.rs index f0fd780..3385cab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(feature="std"), no_std)] -extern crate bigint; +extern crate uint; #[cfg(feature="std")] extern crate core; @@ -21,7 +21,7 @@ use core::{ops, cmp}; use core::cmp::{min, Ordering}; use core::ops::{Deref, DerefMut, BitXor, BitAnd, BitOr, IndexMut, Index}; use core::hash::{Hash, Hasher}; -use bigint::U256; +use uint::U256; #[cfg(feature="std")] use rustc_hex::{FromHex, FromHexError}; @@ -172,7 +172,7 @@ macro_rules! impl_hash { type Err = FromHexError; fn from_str(s: &str) -> Result<$from, FromHexError> { - let a = s.from_hex()?; + let a : Vec = s.from_hex()?; if a.len() != $size { return Err(FromHexError::InvalidHexLength); } From cca50f7bf1b87d4b604040d631407a4ecffde3cc Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 13 Aug 2018 15:35:03 +0200 Subject: [PATCH 2/3] Bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7fcae40..b0eb0a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "parity-hash" -version = "1.2.1" +version = "1.2.2" description = "A collection of fixed-size byte array representations" authors = ["Alexey Frolov "] license = "MIT" From 3bd3437876ccb7426df2c4aad93462e508a3d5c3 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 14 Aug 2018 17:40:00 +0200 Subject: [PATCH 3/3] Update Cargo.toml --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0eb0a6..34b6676 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,7 @@ authors = ["Alexey Frolov "] license = "MIT" [dependencies] -uint = { version = "0.3", path = "../parity-common/uint" } -# uint = "0.3" # NOT PUBLISHED YET +uint = "0.3" rustc-hex = { version = "2.0", default-features = false} serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true }