2024-10-27 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2024-10-27 01:21:24 +00:00 committed by github-actions[bot]
parent b11bd9a6b5
commit 39f46a16bc
6 changed files with 16 additions and 18 deletions

View File

@ -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 {

View File

@ -61,7 +61,7 @@ pub enum DecodeError<E> {
/// 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<E>);

View File

@ -359,8 +359,7 @@ impl<D: fmt::Display> serde::de::Expected for DisplayExpected<D> {
// not a trait impl because we panic on some variants
fn consensus_error_into_serde<E: serde::de::Error>(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

View File

@ -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),

View File

@ -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.

View File

@ -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]