Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Dec 25, 2024
1 parent a811603 commit 5b212ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 10 additions & 5 deletions crates/primitives-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ pub use node::{BodyTy, FullNodePrimitives, HeaderTy, NodePrimitives, ReceiptTy};

/// Helper trait that requires rayon since `rayon` feature is enabled.
#[cfg(feature = "rayon")]
pub trait MaybeIntoParallelIterator: rayon::iter::IntoParallelIterator<Item = <Self as MaybeIntoParallelIterator>::Item> + IntoIterator<Item = <Self as MaybeIntoParallelIterator>::Item> {
pub trait MaybeIntoParallelIterator:
rayon::iter::IntoParallelIterator<Item = <Self as MaybeIntoParallelIterator>::Item>
+ IntoIterator<Item = <Self as MaybeIntoParallelIterator>::Item>
{
/// The type of the elements being iterated over.
type Item;
}
Expand All @@ -108,14 +111,16 @@ pub trait MaybeIntoParallelIterator: IntoIterator {

#[cfg(feature = "rayon")]
impl<T> MaybeIntoParallelIterator for T
where
T: rayon::iter::IntoParallelIterator<Item = <T as IntoIterator>::Item> + IntoIterator,
where
T: rayon::iter::IntoParallelIterator<Item = <T as IntoIterator>::Item> + IntoIterator,
{
type Item = <T as IntoIterator>::Item;

}
#[cfg(not(feature = "rayon"))]
impl<T> MaybeIntoParallelIterator for T where T: core::iter::IntoIterator {
impl<T> MaybeIntoParallelIterator for T
where
T: core::iter::IntoIterator,
{
fn into_par_iter(self) -> Self::IntoIter {
self.into_iter()
}
Expand Down
5 changes: 2 additions & 3 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub use reth_primitives_traits::{
transaction::error::{
InvalidTransactionError, TransactionConversionError, TryFromRecoveredTransactionError,
},
WithEncoded, MaybeIntoParallelIterator
MaybeIntoParallelIterator, WithEncoded,
};
use reth_primitives_traits::{InMemorySize, SignedTransaction};
use revm_primitives::{AuthorizationList, TxEnv};
Expand Down Expand Up @@ -75,8 +75,7 @@ pub static PARALLEL_SENDER_RECOVERY_THRESHOLD: LazyLock<usize> =
/// Expected number of transactions where we can expect a speed-up by recovering the senders in
/// parallel.
#[cfg(not(feature = "rayon"))]
pub static PARALLEL_SENDER_RECOVERY_THRESHOLD: LazyLock<usize> =
LazyLock::new(|| usize::MAX);
pub static PARALLEL_SENDER_RECOVERY_THRESHOLD: LazyLock<usize> = LazyLock::new(|| usize::MAX);

/// A raw transaction.
///
Expand Down

0 comments on commit 5b212ed

Please sign in to comment.