2024-04-07 automated rustfmt nightly
This commit is contained in:
parent
bae2c75f69
commit
747ca578dd
|
@ -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<Params>) -> Result<Address, FromScriptError> {
|
||||
pub fn from_script(
|
||||
script: &Script,
|
||||
params: impl AsRef<Params>,
|
||||
) -> Result<Address, FromScriptError> {
|
||||
let network = params.as_ref().network;
|
||||
if script.is_p2pkh() {
|
||||
let bytes = script.as_bytes()[3..23].try_into().expect("statically 20B long");
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<Params>) -> Self {
|
||||
params.as_ref().network.into()
|
||||
}
|
||||
pub fn from_params(params: impl AsRef<Params>) -> Self { params.as_ref().network.into() }
|
||||
}
|
||||
|
||||
impl FromStr for Magic {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in New Issue