From cf15aa3cd9823c93e5f4f4701a7a008f48a987cf Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Thu, 15 Aug 2024 11:57:42 -0700 Subject: [PATCH] rpc: small refactor in ommer_by_block_and_index --- crates/rpc/rpc-eth-api/src/helpers/block.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/rpc/rpc-eth-api/src/helpers/block.rs b/crates/rpc/rpc-eth-api/src/helpers/block.rs index 837006a970ef..0058ca021cfc 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/block.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/block.rs @@ -202,9 +202,10 @@ pub trait EthBlocks: LoadBlock { } .unwrap_or_default(); - let index = usize::from(index); - let uncle = - uncles.into_iter().nth(index).map(|header| uncle_block_from_header(header).into()); + let uncle = uncles + .into_iter() + .nth(index.into()) + .map(|header| uncle_block_from_header(header).into()); Ok(uncle) } }