Merge rust-bitcoin/rust-bitcoin#3595: Automated nightly rustfmt (2024-11-17)
500cd10802
2024-11-17 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: apoelstra: ACK 500cd10802acc00df3664d7e7a03de7ad0bfe36e; successfully ran local tests; much less offensive this week tcharding: ACK500cd10802
Tree-SHA512: 5dbd91260684f257277c5d2706ce8a95a4bf7d8d1e285e8e71261df35425cc7f512688c11643c4ea585905b05cbdfa221fb99731429d46eb5e33c12ab1088307
This commit is contained in:
commit
c47a41a076
|
@ -1083,24 +1083,16 @@ pub mod test_utils {
|
|||
use crate::pow::{Target, Work, U256};
|
||||
|
||||
/// Converts a `u64` to a [`Work`]
|
||||
pub fn u64_to_work(u: u64) -> Work {
|
||||
Work(U256::from(u))
|
||||
}
|
||||
pub fn u64_to_work(u: u64) -> Work { Work(U256::from(u)) }
|
||||
|
||||
/// Converts a `u128` to a [`Work`]
|
||||
pub fn u128_to_work(u: u128) -> Work {
|
||||
Work(U256::from(u))
|
||||
}
|
||||
pub fn u128_to_work(u: u128) -> Work { Work(U256::from(u)) }
|
||||
|
||||
/// Converts a `u32` to a [`Target`]
|
||||
pub fn u32_to_target(u: u32) -> Target {
|
||||
Target(U256::from(u))
|
||||
}
|
||||
pub fn u32_to_target(u: u32) -> Target { Target(U256::from(u)) }
|
||||
|
||||
/// Converts a `u64` to a [`Target`]
|
||||
pub fn u64_to_target(u: u64) -> Target {
|
||||
Target(U256::from(u))
|
||||
}
|
||||
pub fn u64_to_target(u: u64) -> Target { Target(U256::from(u)) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -53,6 +53,7 @@ pub use units::{
|
|||
fee_rate::{self, FeeRate},
|
||||
weight::{self, Weight},
|
||||
};
|
||||
|
||||
#[doc(inline)]
|
||||
#[cfg(feature = "alloc")]
|
||||
pub use self::{
|
||||
|
|
|
@ -11,8 +11,8 @@ use core::{default, fmt, ops};
|
|||
use arbitrary::{Arbitrary, Unstructured};
|
||||
|
||||
use super::{
|
||||
parse_signed_to_satoshi, split_amount_and_denomination, Amount, Denomination,
|
||||
Display, DisplayStyle, OutOfRangeError, ParseAmountError, ParseError,
|
||||
parse_signed_to_satoshi, split_amount_and_denomination, Amount, Denomination, Display,
|
||||
DisplayStyle, OutOfRangeError, ParseAmountError, ParseError,
|
||||
};
|
||||
|
||||
/// A signed amount.
|
||||
|
|
|
@ -13,8 +13,8 @@ use ::serde::{Deserialize, Serialize};
|
|||
use arbitrary::{Arbitrary, Unstructured};
|
||||
|
||||
use super::{
|
||||
parse_signed_to_satoshi, split_amount_and_denomination, Denomination, Display,
|
||||
DisplayStyle, OutOfRangeError, ParseAmountError, ParseError, SignedAmount,
|
||||
parse_signed_to_satoshi, split_amount_and_denomination, Denomination, Display, DisplayStyle,
|
||||
OutOfRangeError, ParseAmountError, ParseError, SignedAmount,
|
||||
};
|
||||
#[cfg(feature = "alloc")]
|
||||
use crate::{FeeRate, Weight};
|
||||
|
|
|
@ -110,7 +110,7 @@ impl Weight {
|
|||
// No `map()` in const context.
|
||||
match self.0.checked_add(rhs.0) {
|
||||
Some(wu) => Some(Weight::from_wu(wu)),
|
||||
None => None
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ impl Weight {
|
|||
// No `map()` in const context.
|
||||
match self.0.checked_sub(rhs.0) {
|
||||
Some(wu) => Some(Weight::from_wu(wu)),
|
||||
None => None
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ impl Weight {
|
|||
// No `map()` in const context.
|
||||
match self.0.checked_mul(rhs) {
|
||||
Some(wu) => Some(Weight::from_wu(wu)),
|
||||
None => None
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ impl Weight {
|
|||
// No `map()` in const context.
|
||||
match self.0.checked_div(rhs) {
|
||||
Some(wu) => Some(Weight::from_wu(wu)),
|
||||
None => None
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue