Skip to content

Commit

Permalink
convert to where syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
0xForerunner committed Sep 25, 2024
1 parent af8045b commit 865aab4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions crates/net/network/src/transactions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,9 +1396,10 @@ impl PropagateTransaction {
}

/// Create a new instance from a pooled transaction
fn new<T: PoolTransaction<Consensus: Into<TransactionSignedEcRecovered>>>(
tx: Arc<ValidPoolTransaction<T>>,
) -> Self {
fn new<T>(tx: Arc<ValidPoolTransaction<T>>) -> Self
where
T: PoolTransaction<Consensus: Into<TransactionSignedEcRecovered>>,
{
let size = tx.encoded_length();
let recovered: TransactionSignedEcRecovered =
tx.transaction.clone().into_consensus().into();
Expand Down
5 changes: 3 additions & 2 deletions crates/transaction-pool/src/validate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,9 @@ impl<T: PoolTransaction> ValidPoolTransaction<T> {
}
}

impl<T: PoolTransaction<Consensus: Into<TransactionSignedEcRecovered>>> ToRecoveredTransaction
for ValidPoolTransaction<T>
impl<T> ToRecoveredTransaction for ValidPoolTransaction<T>
where
T: PoolTransaction<Consensus: Into<TransactionSignedEcRecovered>>,
{
fn to_recovered_transaction(&self) -> TransactionSignedEcRecovered {
self.transaction.clone().into_consensus().into()
Expand Down

0 comments on commit 865aab4

Please sign in to comment.