Skip to content

Commit c47a41a

Browse files
committed
Merge rust-bitcoin#3595: Automated nightly rustfmt (2024-11-17)
500cd10 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 500cd10; successfully ran local tests; much less offensive this week tcharding: ACK 500cd10 Tree-SHA512: 5dbd91260684f257277c5d2706ce8a95a4bf7d8d1e285e8e71261df35425cc7f512688c11643c4ea585905b05cbdfa221fb99731429d46eb5e33c12ab1088307
2 parents dbedac1 + 500cd10 commit c47a41a

File tree

5 files changed

+13
-20
lines changed

5 files changed

+13
-20
lines changed

bitcoin/src/pow.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,24 +1083,16 @@ pub mod test_utils {
10831083
use crate::pow::{Target, Work, U256};
10841084

10851085
/// Converts a `u64` to a [`Work`]
1086-
pub fn u64_to_work(u: u64) -> Work {
1087-
Work(U256::from(u))
1088-
}
1086+
pub fn u64_to_work(u: u64) -> Work { Work(U256::from(u)) }
10891087

10901088
/// Converts a `u128` to a [`Work`]
1091-
pub fn u128_to_work(u: u128) -> Work {
1092-
Work(U256::from(u))
1093-
}
1089+
pub fn u128_to_work(u: u128) -> Work { Work(U256::from(u)) }
10941090

10951091
/// Converts a `u32` to a [`Target`]
1096-
pub fn u32_to_target(u: u32) -> Target {
1097-
Target(U256::from(u))
1098-
}
1092+
pub fn u32_to_target(u: u32) -> Target { Target(U256::from(u)) }
10991093

11001094
/// Converts a `u64` to a [`Target`]
1101-
pub fn u64_to_target(u: u64) -> Target {
1102-
Target(U256::from(u))
1103-
}
1095+
pub fn u64_to_target(u: u64) -> Target { Target(U256::from(u)) }
11041096
}
11051097

11061098
#[cfg(test)]

primitives/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub use units::{
5353
fee_rate::{self, FeeRate},
5454
weight::{self, Weight},
5555
};
56+
5657
#[doc(inline)]
5758
#[cfg(feature = "alloc")]
5859
pub use self::{

units/src/amount/signed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use core::{default, fmt, ops};
1111
use arbitrary::{Arbitrary, Unstructured};
1212

1313
use super::{
14-
parse_signed_to_satoshi, split_amount_and_denomination, Amount, Denomination,
15-
Display, DisplayStyle, OutOfRangeError, ParseAmountError, ParseError,
14+
parse_signed_to_satoshi, split_amount_and_denomination, Amount, Denomination, Display,
15+
DisplayStyle, OutOfRangeError, ParseAmountError, ParseError,
1616
};
1717

1818
/// A signed amount.

units/src/amount/unsigned.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use ::serde::{Deserialize, Serialize};
1313
use arbitrary::{Arbitrary, Unstructured};
1414

1515
use super::{
16-
parse_signed_to_satoshi, split_amount_and_denomination, Denomination, Display,
17-
DisplayStyle, OutOfRangeError, ParseAmountError, ParseError, SignedAmount,
16+
parse_signed_to_satoshi, split_amount_and_denomination, Denomination, Display, DisplayStyle,
17+
OutOfRangeError, ParseAmountError, ParseError, SignedAmount,
1818
};
1919
#[cfg(feature = "alloc")]
2020
use crate::{FeeRate, Weight};

units/src/weight.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl Weight {
110110
// No `map()` in const context.
111111
match self.0.checked_add(rhs.0) {
112112
Some(wu) => Some(Weight::from_wu(wu)),
113-
None => None
113+
None => None,
114114
}
115115
}
116116

@@ -121,7 +121,7 @@ impl Weight {
121121
// No `map()` in const context.
122122
match self.0.checked_sub(rhs.0) {
123123
Some(wu) => Some(Weight::from_wu(wu)),
124-
None => None
124+
None => None,
125125
}
126126
}
127127

@@ -132,7 +132,7 @@ impl Weight {
132132
// No `map()` in const context.
133133
match self.0.checked_mul(rhs) {
134134
Some(wu) => Some(Weight::from_wu(wu)),
135-
None => None
135+
None => None,
136136
}
137137
}
138138

@@ -143,7 +143,7 @@ impl Weight {
143143
// No `map()` in const context.
144144
match self.0.checked_div(rhs) {
145145
Some(wu) => Some(Weight::from_wu(wu)),
146-
None => None
146+
None => None,
147147
}
148148
}
149149
}

0 commit comments

Comments
 (0)