From 39f46a16bc0da356f495166ccd5829627af3749b Mon Sep 17 00:00:00 2001 From: Fmt Bot Date: Sun, 27 Oct 2024 01:21:24 +0000 Subject: [PATCH] 2024-10-27 automated rustfmt nightly --- bitcoin/src/blockdata/witness.rs | 20 ++++++++------------ bitcoin/src/consensus/error.rs | 2 +- bitcoin/src/consensus/serde.rs | 3 +-- bitcoin/src/psbt/error.rs | 3 ++- bitcoin/src/taproot/mod.rs | 4 +++- primitives/src/lib.rs | 2 +- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/bitcoin/src/blockdata/witness.rs b/bitcoin/src/blockdata/witness.rs index cf89c0435..04c16d2b1 100644 --- a/bitcoin/src/blockdata/witness.rs +++ b/bitcoin/src/blockdata/witness.rs @@ -49,19 +49,15 @@ impl Decodable for Witness { let element_size_len = compact_size::encoded_size(element_size); let required_len = cursor .checked_add(element_size) - .ok_or(encode::Error::Parse( - encode::ParseError::OversizedVectorAllocation { - requested: usize::MAX, - max: MAX_VEC_SIZE, - }, - ))? + .ok_or(encode::Error::Parse(encode::ParseError::OversizedVectorAllocation { + requested: usize::MAX, + max: MAX_VEC_SIZE, + }))? .checked_add(element_size_len) - .ok_or(encode::Error::Parse( - encode::ParseError::OversizedVectorAllocation { - requested: usize::MAX, - max: MAX_VEC_SIZE, - }, - ))?; + .ok_or(encode::Error::Parse(encode::ParseError::OversizedVectorAllocation { + requested: usize::MAX, + max: MAX_VEC_SIZE, + }))?; if required_len > MAX_VEC_SIZE + witness_index_space { return Err(encode::ParseError::OversizedVectorAllocation { diff --git a/bitcoin/src/consensus/error.rs b/bitcoin/src/consensus/error.rs index cfd9f256a..72d6c222b 100644 --- a/bitcoin/src/consensus/error.rs +++ b/bitcoin/src/consensus/error.rs @@ -61,7 +61,7 @@ pub enum DecodeError { /// Data unconsumed error. Unconsumed, /// Other decoding error. - Other(E), // Yielded by the inner iterator. + Other(E), // Yielded by the inner iterator. } internals::impl_from_infallible!(DecodeError); diff --git a/bitcoin/src/consensus/serde.rs b/bitcoin/src/consensus/serde.rs index 8ef5e275e..dcaf2287c 100644 --- a/bitcoin/src/consensus/serde.rs +++ b/bitcoin/src/consensus/serde.rs @@ -359,8 +359,7 @@ impl serde::de::Expected for DisplayExpected { // not a trait impl because we panic on some variants fn consensus_error_into_serde(error: ParseError) -> E { match error { - ParseError::MissingData => - E::custom("missing data (early end of file or slice too short)"), + ParseError::MissingData => E::custom("missing data (early end of file or slice too short)"), ParseError::OversizedVectorAllocation { requested, max } => E::custom(format_args!( "the requested allocation of {} items exceeds maximum of {}", requested, max diff --git a/bitcoin/src/psbt/error.rs b/bitcoin/src/psbt/error.rs index e1d266650..26da3e4f6 100644 --- a/bitcoin/src/psbt/error.rs +++ b/bitcoin/src/psbt/error.rs @@ -147,7 +147,8 @@ impl fmt::Display for Error { ConsensusEncoding(ref e) => write_err!(f, "bitcoin consensus encoding error"; e), ConsensusDeserialize(ref e) => write_err!(f, "bitcoin consensus deserializaton error"; e), - ConsensusParse(ref e) => write_err!(f, "error parsing bitcoin consensus encoded object"; e), + ConsensusParse(ref e) => + write_err!(f, "error parsing bitcoin consensus encoded object"; e), NegativeFee => f.write_str("PSBT has a negative fee which is not allowed"), FeeOverflow => f.write_str("integer overflow in fee calculation"), InvalidPublicKey(ref e) => write_err!(f, "invalid public key"; e), diff --git a/bitcoin/src/taproot/mod.rs b/bitcoin/src/taproot/mod.rs index 350da2cfb..32b986def 100644 --- a/bitcoin/src/taproot/mod.rs +++ b/bitcoin/src/taproot/mod.rs @@ -27,7 +27,9 @@ use crate::{Script, ScriptBuf}; pub use crate::crypto::taproot::{SigFromSliceError, Signature}; #[doc(inline)] pub use merkle_branch::TaprootMerkleBranch; -pub use primitives::taproot::{TapLeafTag, TapLeafHash, TapBranchTag, TapNodeHash, TapTweakTag, TapTweakHash}; +pub use primitives::taproot::{ + TapBranchTag, TapLeafHash, TapLeafTag, TapNodeHash, TapTweakHash, TapTweakTag, +}; crate::internal_macros::define_extension_trait! { /// Extension functionality for the [`TapTweakHash`] type. diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 51ff69297..b1702b55f 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -58,8 +58,8 @@ pub use self::{ #[cfg(feature = "alloc")] pub use self::{ locktime::{absolute, relative}, - witness::Witness, transaction::{TxIn, TxOut}, + witness::Witness, }; #[rustfmt::skip]