Skip to content

Automated nightly rustfmt (2025-04-27) #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base58/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ where
#[cfg(test)]
mod tests {
use alloc::vec;

use hex::FromHex as _;

use super::*;
Expand Down
3 changes: 2 additions & 1 deletion bitcoin/src/blockdata/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ mod test {

#[test]
fn consensus_serialize() {
let el_0 = hex!("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105").to_vec();
let el_0 =
hex!("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105").to_vec();
let el_1 = hex!("000000").to_vec();

let mut want_witness = Witness::default();
Expand Down
4 changes: 2 additions & 2 deletions bitcoin/src/merkle_tree/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ impl std::error::Error for MerkleBlockError {

#[cfg(test)]
mod tests {
use hex::{DisplayHex, FromHex};
use hex_lit::hex;
#[cfg(feature = "rand-std")]
use {core::cmp, secp256k1::rand::prelude::*};

use super::*;
use crate::block::{BlockUncheckedExt as _, Unchecked};
use crate::consensus::encode;
use crate::hash_types::Txid;
use hex::{DisplayHex, FromHex};
use hex_lit::hex;

#[cfg(feature = "rand-std")]
macro_rules! pmt_tests {
Expand Down
4 changes: 3 additions & 1 deletion bitcoin/src/taproot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,9 @@ impl TryFrom<TaprootBuilder> for TapTree {
///
/// A [`TapTree`] iff the `builder` is complete, otherwise return [`IncompleteBuilderError`]
/// error with the content of incomplete `builder` instance.
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error> { builder.try_into_tap_tree() }
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error> {
builder.try_into_tap_tree()
}
}

impl TryFrom<NodeInfo> for TapTree {
Expand Down
3 changes: 2 additions & 1 deletion primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ impl fmt::Display for Header {
self.time.to_u32().to_le_bytes().as_hex(),
self.bits.to_consensus().to_le_bytes().as_hex(),
self.nonce.to_le_bytes().as_hex(),
).expect("total length of written objects is 160 characters");
)
.expect("total length of written objects is 160 characters");
fmt::Display::fmt(&buf, f)
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ mod test {
let witness4: Witness = empty_data.iter().collect();
assert!(witness4.is_empty());
}

#[cfg(feature = "hex")]
#[test]
fn test_from_hex() {
Expand Down
2 changes: 1 addition & 1 deletion units/src/amount/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use core::ops;
use NumOpResult as R;

use super::{Amount, SignedAmount};
use crate::internal_macros::{impl_div_assign, impl_mul_assign};
use crate::{MathOp, NumOpError, NumOpResult, OptionExt};
use crate::internal_macros::{impl_mul_assign, impl_div_assign};

impl From<Amount> for NumOpResult<Amount> {
fn from(a: Amount) -> Self { Self::Valid(a) }
Expand Down
8 changes: 2 additions & 6 deletions units/src/amount/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ fn sat(sat: u64) -> Amount { Amount::from_sat(sat).unwrap() }
fn ssat(ssat: i64) -> SignedAmount { SignedAmount::from_sat(ssat).unwrap() }

#[track_caller]
fn res(n_sat: u64) -> NumOpResult<Amount>{
NumOpResult::from(sat(n_sat))
}
fn res(n_sat: u64) -> NumOpResult<Amount> { NumOpResult::from(sat(n_sat)) }

#[track_caller]
fn sres(n_sat: i64) -> NumOpResult<SignedAmount>{
NumOpResult::from(ssat(n_sat))
}
fn sres(n_sat: i64) -> NumOpResult<SignedAmount> { NumOpResult::from(ssat(n_sat)) }

#[test]
fn sanity_check() {
Expand Down
2 changes: 1 addition & 1 deletion units/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

//! Provides a monodic type returned by mathematical operations (`core::ops`).

use core::fmt;
use core::convert::Infallible;
use core::fmt;

use NumOpResult as R;

Expand Down