datasource/ethereum: Refactor to use '?'
@@ -298,7 +298,8 @@ where
Box::new(block_opt_future.and_then(move |block_opt| {
let web3 = web3.clone();
- block_opt.map(move |block| {
+ let block = block_opt?;
+
let receipt_futures = block
.transactions
.iter()
@@ -347,13 +348,14 @@ where
})
}).collect::<Vec<_>>();
+ Some(
stream::futures_ordered(receipt_futures).collect().map(
move |transaction_receipts| EthereumBlock {
block,
transaction_receipts,
},
)
- })
+ )
}))
}
