Merge rust-bitcoin/rust-bitcoin#3518: Automated nightly rustfmt (2024-10-27)
39f46a16bc
2024-10-27 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: tcharding: ACK39f46a16bc
apoelstra: ACK 39f46a16bc0da356f495166ccd5829627af3749b; successfully ran local tests Tree-SHA512: 6c27714b18ad6957104246145a2d4243f8e43e378d63f3d946ba05ecaf859432f2fe363fe3e7a29a33c41297216fd1176c165ac55deb109f636813c637ff6c43
This commit is contained in:
commit
1f578fc929
|
@ -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 {
|
||||
|
|
|
@ -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>);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -65,8 +65,8 @@ pub use self::{
|
|||
#[cfg(feature = "alloc")]
|
||||
pub use self::{
|
||||
locktime::{absolute, relative},
|
||||
witness::Witness,
|
||||
transaction::{TxIn, TxOut},
|
||||
witness::Witness,
|
||||
};
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
Loading…
Reference in New Issue