From 21cf8bebb37b209fd349e9b957a9abcb3de22e97 Mon Sep 17 00:00:00 2001 From: clabby Date: Thu, 23 Nov 2023 18:24:25 -0500 Subject: [PATCH] @rkasiuk review --- crates/net/eth-wire/src/multiplex.rs | 2 +- crates/primitives/src/receipt.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/net/eth-wire/src/multiplex.rs b/crates/net/eth-wire/src/multiplex.rs index d0dcf467e59c8..c1aa82e886b13 100644 --- a/crates/net/eth-wire/src/multiplex.rs +++ b/crates/net/eth-wire/src/multiplex.rs @@ -239,7 +239,7 @@ where return Poll::Ready(Some(Err(err.into()))) } } else { - break; + break } } Poll::Pending => { diff --git a/crates/primitives/src/receipt.rs b/crates/primitives/src/receipt.rs index 1ec1fe8b19cb0..43882762d15d6 100644 --- a/crates/primitives/src/receipt.rs +++ b/crates/primitives/src/receipt.rs @@ -218,7 +218,7 @@ impl proptest::arbitrary::Arbitrary for Receipt { #[cfg(feature = "optimism")] let (deposit_nonce, deposit_receipt_version) = if tx_type == TxType::DEPOSIT { // The deposit receipt version is only present if the deposit nonce is present - let deposit_receipt_version = _deposit_nonce.is_some().then_some(_deposit_receipt_version).flatten(); + let deposit_receipt_version = _deposit_nonce.and(_deposit_receipt_version); (_deposit_nonce, deposit_receipt_version) } else { (None, None) @@ -255,8 +255,10 @@ impl<'a> arbitrary::Arbitrary<'a> for Receipt { #[cfg(feature = "optimism")] let (deposit_nonce, deposit_receipt_version) = if tx_type == TxType::DEPOSIT { let deposit_nonce = Option::::arbitrary(u)?; - let deposit_nonce_version = - deposit_nonce.is_some().then(|| Option::::arbitrary(u)).transpose()?.flatten(); + let deposit_nonce_version = deposit_nonce + .and_then(|_| Some(Option::::arbitrary(u))) + .transpose()? + .flatten(); (deposit_nonce, deposit_nonce_version) } else { (None, None)