Merge rust-bitcoin/rust-bitcoin#3799: Automated nightly rustfmt (2024-12-22)
19acae7163
2024-12-22 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: ACK19acae7163
apoelstra: ACK 19acae716334ce2b215e4baf1cf405d05b326a9a; successfully ran local tests Tree-SHA512: 93b1959faab558d8ebf825f70014cbef6ae21b28db7fff18bab4a3f1ae7c6ff331091a94548caf6d63dd5f0bb40e4d0833cb089388fbac4467e6ea80a9230dfc
This commit is contained in:
commit
dacf75594e
|
@ -907,13 +907,11 @@ fn checked_sum_amounts() {
|
|||
let sum = amounts.into_iter().checked_sum();
|
||||
assert_eq!(None, sum);
|
||||
|
||||
let amounts =
|
||||
[SignedAmount::MIN, SignedAmount::from_sat(-1), SignedAmount::from_sat(21)];
|
||||
let amounts = [SignedAmount::MIN, SignedAmount::from_sat(-1), SignedAmount::from_sat(21)];
|
||||
let sum = amounts.into_iter().checked_sum();
|
||||
assert_eq!(None, sum);
|
||||
|
||||
let amounts =
|
||||
[SignedAmount::MAX, SignedAmount::from_sat(1), SignedAmount::from_sat(21)];
|
||||
let amounts = [SignedAmount::MAX, SignedAmount::from_sat(1), SignedAmount::from_sat(21)];
|
||||
let sum = amounts.into_iter().checked_sum();
|
||||
assert_eq!(None, sum);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ macro_rules! impl_add_for_references {
|
|||
|
||||
fn add(self, rhs: &'a $ty) -> Self::Output { *self + *rhs }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use impl_add_for_references;
|
||||
|
||||
|
@ -44,7 +44,7 @@ macro_rules! impl_add_assign {
|
|||
impl core::ops::AddAssign<&$ty> for $ty {
|
||||
fn add_assign(&mut self, rhs: &$ty) { *self = *self + *rhs }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use impl_add_assign;
|
||||
|
||||
|
@ -74,7 +74,7 @@ macro_rules! impl_sub_for_references {
|
|||
|
||||
fn sub(self, rhs: &'a $ty) -> Self::Output { *self - *rhs }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use impl_sub_for_references;
|
||||
|
||||
|
@ -88,6 +88,6 @@ macro_rules! impl_sub_assign {
|
|||
impl core::ops::SubAssign<&$ty> for $ty {
|
||||
fn sub_assign(&mut self, rhs: &$ty) { *self = *self - *rhs }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use impl_sub_assign;
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
// These imports test "typical" usage by user code.
|
||||
#[cfg(feature = "arbitrary")]
|
||||
use arbitrary::{Arbitrary, Unstructured};
|
||||
use bitcoin_units::locktime::{absolute, relative}; // Typical usage is `absolute::Height`.
|
||||
use bitcoin_units::{
|
||||
amount, block, fee_rate, locktime, parse, weight, Amount, BlockHeight, BlockInterval, FeeRate,
|
||||
SignedAmount, Weight,
|
||||
};
|
||||
#[cfg(feature = "arbitrary")]
|
||||
use arbitrary::{Arbitrary, Unstructured};
|
||||
|
||||
/// A struct that includes all public non-error enums.
|
||||
#[derive(Debug)] // All public types implement Debug (C-DEBUG).
|
||||
|
@ -289,9 +289,7 @@ impl<'a> Arbitrary<'a> for Structs {
|
|||
#[cfg(feature = "arbitrary")]
|
||||
impl<'a> Arbitrary<'a> for Enums {
|
||||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
||||
let a = Enums {
|
||||
a: amount::Denomination::arbitrary(u)?,
|
||||
};
|
||||
let a = Enums { a: amount::Denomination::arbitrary(u)? };
|
||||
Ok(a)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue