2024-09-22 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2024-09-22 01:20:08 +00:00 committed by github-actions[bot]
parent f804e0027b
commit 2009763ae5
4 changed files with 10 additions and 13 deletions

View File

@ -1412,10 +1412,7 @@ impl InputWeightPrediction {
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for OutPoint {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
Ok(OutPoint{
txid: Txid::arbitrary(u)?,
vout: u32::arbitrary(u)?
})
Ok(OutPoint { txid: Txid::arbitrary(u)?, vout: u32::arbitrary(u)? })
}
}
@ -1426,7 +1423,7 @@ impl<'a> Arbitrary<'a> for TxIn {
previous_output: OutPoint::arbitrary(u)?,
script_sig: ScriptBuf::arbitrary(u)?,
sequence: Sequence::arbitrary(u)?,
witness: Witness::arbitrary(u)?
witness: Witness::arbitrary(u)?,
})
}
}
@ -1440,7 +1437,7 @@ impl<'a> Arbitrary<'a> for Transaction {
version: Version::arbitrary(u)?,
lock_time: LockTime::arbitrary(u)?,
input: Vec::<TxIn>::arbitrary(u)?,
output: Vec::<TxOut>::arbitrary(u)?
output: Vec::<TxOut>::arbitrary(u)?,
})
}
}

View File

@ -7,6 +7,8 @@
use core::fmt;
use core::ops::Index;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use internals::compact_size;
use io::{BufRead, Write};
@ -18,8 +20,6 @@ use crate::prelude::Vec;
use crate::script::ScriptExt as _;
use crate::taproot::{self, TAPROOT_ANNEX_PREFIX};
use crate::{Script, VarInt};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
/// The Witness is the data used to unlock bitcoin since the [segwit upgrade].
///
@ -623,7 +623,7 @@ impl Default for Witness {
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for Witness {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let arbitrary_bytes = Vec::<Vec::<u8>>::arbitrary(u)?;
let arbitrary_bytes = Vec::<Vec<u8>>::arbitrary(u)?;
Ok(Witness::from_slice(&arbitrary_bytes))
}
}

View File

@ -17,6 +17,8 @@
use core::fmt;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use internals::impl_to_hex_from_lower_hex;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
@ -24,8 +26,6 @@ use serde::{Deserialize, Serialize};
use units::locktime::relative::TimeOverflowError;
#[cfg(feature = "alloc")]
use units::parse::{self, PrefixedHexError, UnprefixedHexError};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
#[cfg(feature = "alloc")]
use crate::locktime::relative;

View File

@ -12,9 +12,9 @@
use core::fmt;
use hashes::sha256d;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use hashes::sha256d;
hashes::hash_newtype! {
/// A bitcoin transaction hash/transaction ID.