diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index 3ec7fac3..ca67b99c 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -506,7 +506,10 @@ impl Address { pub fn is_spend_standard(&self) -> bool { self.address_type().is_some() } /// Constructs an [`Address`] from an output script (`scriptPubkey`). - pub fn from_script(script: &Script, params: impl AsRef) -> Result { + pub fn from_script( + script: &Script, + params: impl AsRef, + ) -> Result { let network = params.as_ref().network; if script.is_p2pkh() { let bytes = script.as_bytes()[3..23].try_into().expect("statically 20B long"); diff --git a/bitcoin/src/blockdata/constants.rs b/bitcoin/src/blockdata/constants.rs index d59072b7..0b01831f 100644 --- a/bitcoin/src/blockdata/constants.rs +++ b/bitcoin/src/blockdata/constants.rs @@ -198,8 +198,8 @@ mod test { use hex::test_hex_unwrap as hex; use super::*; - use crate::consensus::params; use crate::consensus::encode::serialize; + use crate::consensus::params; #[test] fn bitcoin_genesis_first_transaction() { diff --git a/bitcoin/src/p2p/mod.rs b/bitcoin/src/p2p/mod.rs index 8a3147c7..42d49030 100644 --- a/bitcoin/src/p2p/mod.rs +++ b/bitcoin/src/p2p/mod.rs @@ -229,9 +229,7 @@ impl Magic { pub fn to_bytes(self) -> [u8; 4] { self.0 } /// Returns the magic bytes for the network defined by `params`. - pub fn from_params(params: impl AsRef) -> Self { - params.as_ref().network.into() - } + pub fn from_params(params: impl AsRef) -> Self { params.as_ref().network.into() } } impl FromStr for Magic { diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 5dbb9482..140698e4 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -18,7 +18,9 @@ use units::parse; use crate::blockdata::block::BlockHash; use crate::consensus::encode::{self, Decodable, Encodable}; use crate::consensus::Params; -use crate::error::{ContainsPrefixError, MissingPrefixError, ParseIntError, PrefixedHexError, UnprefixedHexError}; +use crate::error::{ + ContainsPrefixError, MissingPrefixError, ParseIntError, PrefixedHexError, UnprefixedHexError, +}; /// Implement traits and methods shared by `Target` and `Work`. macro_rules! do_impl { diff --git a/units/src/lib.rs b/units/src/lib.rs index b2c27879..393b5ced 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -45,17 +45,14 @@ pub mod parse; #[cfg(feature = "alloc")] pub mod weight; +pub use self::amount::ParseAmountError; #[doc(inline)] pub use self::amount::{Amount, SignedAmount}; -pub use self::amount::ParseAmountError; #[cfg(feature = "alloc")] pub use self::parse::ParseIntError; #[cfg(feature = "alloc")] #[doc(inline)] -pub use self::{ - fee_rate::FeeRate, - weight::Weight, -}; +pub use self::{fee_rate::FeeRate, weight::Weight}; #[rustfmt::skip] #[allow(unused_imports)]