util reexports less std

This commit is contained in:
debris
2017-07-29 17:12:07 +02:00
parent e84f308264
commit eecd823d32
74 changed files with 255 additions and 168 deletions

View File

@@ -17,6 +17,7 @@
use std::fmt;
use std::ops::Deref;
use std::str::FromStr;
use rustc_hex::ToHex;
use secp256k1::key;
use bigint::hash::H256;
use {Error, SECP256K1};
@@ -26,6 +27,12 @@ pub struct Secret {
inner: H256,
}
impl ToHex for Secret {
fn to_hex(&self) -> String {
self.inner.to_hex()
}
}
impl fmt::Debug for Secret {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "Secret: 0x{:x}{:x}..{:x}{:x}", self.inner[0], self.inner[1], self.inner[30], self.inner[31])