fix some recent rustc warnings
This commit is contained in:
parent
783948446c
commit
24ebc29005
|
@ -137,7 +137,6 @@ impl Address {
|
||||||
/// Create a witness pay to script hash address
|
/// Create a witness pay to script hash address
|
||||||
pub fn p2wsh (script: &script::Script, network: Network) -> Address {
|
pub fn p2wsh (script: &script::Script, network: Network) -> Address {
|
||||||
use bitcoin_hashes::sha256;
|
use bitcoin_hashes::sha256;
|
||||||
use bitcoin_hashes::Hash;
|
|
||||||
|
|
||||||
Address {
|
Address {
|
||||||
network: network,
|
network: network,
|
||||||
|
@ -156,8 +155,6 @@ impl Address {
|
||||||
/// This is a segwit address type that looks familiar (as p2sh) to legacy clients
|
/// This is a segwit address type that looks familiar (as p2sh) to legacy clients
|
||||||
pub fn p2shwsh (script: &script::Script, network: Network) -> Address {
|
pub fn p2shwsh (script: &script::Script, network: Network) -> Address {
|
||||||
use bitcoin_hashes::sha256;
|
use bitcoin_hashes::sha256;
|
||||||
use bitcoin_hashes::Hash;
|
|
||||||
use bitcoin_hashes::hash160;
|
|
||||||
|
|
||||||
let ws = script::Builder::new().push_int(0)
|
let ws = script::Builder::new().push_int(0)
|
||||||
.push_slice(&sha256::Hash::hash(&script[..])[..])
|
.push_slice(&sha256::Hash::hash(&script[..])[..])
|
||||||
|
|
|
@ -43,9 +43,12 @@ pub struct Pair {
|
||||||
|
|
||||||
impl fmt::Display for Key {
|
impl fmt::Display for Key {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use hex;
|
write!(
|
||||||
|
f,
|
||||||
write!(f, "type: {:#x}, key: {}", self.type_value, hex::encode(&self.key))
|
"type: {:#x}, key: {}",
|
||||||
|
self.type_value,
|
||||||
|
::hex::encode(&self.key)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue