Skip to content

Commit

Permalink
Merge rust-bitcoin#2668: Automated nightly rustfmt (2024-04-07)
Browse files Browse the repository at this point in the history
747ca57 2024-04-07 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 747ca57
  tcharding:
    ACK 747ca57

Tree-SHA512: c4387388f2cfcb9b9aacf7023d024379cbf073166f04fcba4b4c0d66972ee109f4c9f66e0d8ed1d57c419266680a9e6953a5e38ecb0aa937e6c368d59aaba976
  • Loading branch information
apoelstra committed Apr 8, 2024
2 parents 59a262e + 747ca57 commit 163bf64
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
5 changes: 4 additions & 1 deletion bitcoin/src/address/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/blockdata/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions bitcoin/src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion bitcoin/src/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 2 additions & 5 deletions units/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 163bf64

Please sign in to comment.