Skip to content

Commit 23f8149

Browse files
Fmt Botgithub-actions[bot]
authored andcommitted
2025-08-10 automated rustfmt nightly
1 parent 4a510e3 commit 23f8149

4 files changed

Lines changed: 8 additions & 22 deletions

File tree

internals/src/const_casts.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@
66
//! clear while maintaining compile-time evaluation capabilities.
77
88
/// Converts `u16` to `u64`
9-
pub const fn u16_to_u64(value: u16) -> u64 {
10-
value as u64
11-
}
9+
pub const fn u16_to_u64(value: u16) -> u64 { value as u64 }
1210

1311
/// Converts `u32` to `u64`
14-
pub const fn u32_to_u64(value: u32) -> u64 {
15-
value as u64
16-
}
12+
pub const fn u32_to_u64(value: u32) -> u64 { value as u64 }
1713

1814
/// Converts `i16` to `i64`
19-
pub const fn i16_to_i64(value: i16) -> i64 {
20-
value as i64
21-
}
15+
pub const fn i16_to_i64(value: i16) -> i64 { value as i64 }
2216

2317
/// Converts `u16` to `u32`
24-
pub const fn u16_to_u32(value: u16) -> u32 {
25-
value as u32
26-
}
18+
pub const fn u16_to_u32(value: u16) -> u32 { value as u32 }

p2p/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,11 @@ impl ProtocolVersion {
8080

8181
impl ProtocolVersion {
8282
/// Construct a protocol version that is not well-known.
83-
pub fn from_nonstandard(version: u32) -> Self {
84-
Self(version)
85-
}
83+
pub fn from_nonstandard(version: u32) -> Self { Self(version) }
8684
}
8785

8886
impl From<ProtocolVersion> for u32 {
89-
fn from(version: ProtocolVersion) -> Self {
90-
version.0
91-
}
87+
fn from(version: ProtocolVersion) -> Self { version.0 }
9288
}
9389

9490
impl Encodable for ProtocolVersion {

units/src/amount/unsigned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use core::{default, fmt};
99

1010
#[cfg(feature = "arbitrary")]
1111
use arbitrary::{Arbitrary, Unstructured};
12+
use internals::const_casts;
1213
use NumOpResult as R;
1314

1415
use super::error::{ParseAmountErrorInner, ParseErrorInner};
@@ -17,7 +18,6 @@ use super::{
1718
OutOfRangeError, ParseAmountError, ParseError, SignedAmount,
1819
};
1920
use crate::{FeeRate, MathOp, NumOpError as E, NumOpResult, Weight};
20-
use internals::const_casts;
2121

2222
mod encapsulate {
2323
use super::OutOfRangeError;

units/src/locktime/relative/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,7 @@ impl NumberOf512Seconds {
547547

548548
/// Represents the [`NumberOf512Seconds`] as an integer number of seconds.
549549
#[inline]
550-
pub const fn to_seconds(self) -> u32 {
551-
const_casts::u16_to_u32(self.0) * 512
552-
}
550+
pub const fn to_seconds(self) -> u32 { const_casts::u16_to_u32(self.0) * 512 }
553551

554552
/// Returns the inner `u16` value.
555553
#[inline]

0 commit comments

Comments
 (0)