From 95303a1d2854246f14a753ed5467d863b5b11acc Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 21 Aug 2018 01:00:10 -0700 Subject: [PATCH] Use full path in macros to to eliminate uses --- src/blockdata/block.rs | 2 +- src/internal_macros.rs | 8 ++++---- src/network/message_network.rs | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/blockdata/block.rs b/src/blockdata/block.rs index c7919f5f..3761e2b4 100644 --- a/src/blockdata/block.rs +++ b/src/blockdata/block.rs @@ -25,7 +25,7 @@ use util::Error::{SpvBadTarget, SpvBadProofOfWork}; use util::hash::Sha256dHash; use util::uint::Uint256; use network::encodable::VarInt; -use network::serialize::{self, BitcoinHash}; +use network::serialize::BitcoinHash; use network::constants::Network; use blockdata::transaction::Transaction; use blockdata::constants::max_target; diff --git a/src/internal_macros.rs b/src/internal_macros.rs index b162183e..cdb84c78 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -16,7 +16,7 @@ macro_rules! impl_consensus_encoding { ($thing:ident, $($field:ident),+) => ( impl ::network::encodable::ConsensusEncodable for $thing { #[inline] - fn consensus_encode(&self, s: &mut S) -> Result<(), serialize::Error> { + fn consensus_encode(&self, s: &mut S) -> Result<(), ::network::serialize::Error> { $( self.$field.consensus_encode(s)?; )+ Ok(()) } @@ -24,7 +24,7 @@ macro_rules! impl_consensus_encoding { impl ::network::encodable::ConsensusDecodable for $thing { #[inline] - fn consensus_decode(d: &mut D) -> Result<$thing, serialize::Error> { + fn consensus_decode(d: &mut D) -> Result<$thing, ::network::serialize::Error> { use network::encodable::ConsensusDecodable; Ok($thing { $( $field: ConsensusDecodable::consensus_decode(d)?, )+ @@ -38,7 +38,7 @@ macro_rules! impl_newtype_consensus_encoding { ($thing:ident) => ( impl ::network::encodable::ConsensusEncodable for $thing { #[inline] - fn consensus_encode(&self, s: &mut S) -> Result<(), serialize::Error> { + fn consensus_encode(&self, s: &mut S) -> Result<(), ::network::serialize::Error> { let &$thing(ref data) = self; data.consensus_encode(s) } @@ -46,7 +46,7 @@ macro_rules! impl_newtype_consensus_encoding { impl ::network::encodable::ConsensusDecodable for $thing { #[inline] - fn consensus_decode(d: &mut D) -> Result<$thing, serialize::Error> { + fn consensus_decode(d: &mut D) -> Result<$thing, ::network::serialize::Error> { Ok($thing(ConsensusDecodable::consensus_decode(d)?)) } } diff --git a/src/network/message_network.rs b/src/network/message_network.rs index 38abe8a0..93c4dfab 100644 --- a/src/network/message_network.rs +++ b/src/network/message_network.rs @@ -20,7 +20,6 @@ use network::constants; use network::address::Address; -use network::serialize; use network::socket::Socket; use util;