chore: use let some notation (#12494)

This commit is contained in:
Matthias Seitz
2024-11-13 10:15:34 +01:00
committed by GitHub
parent 39392e95f1
commit 03f3646355

View File

@ -80,14 +80,12 @@ where
{
let (peer_id, response) = client.get_block_body(header.hash()).await?.split();
if response.is_none() {
let Some(body) = response else {
client.report_bad_message(peer_id);
eyre::bail!("Invalid number of bodies received. Expected: 1. Received: 0")
}
};
let body = response.unwrap();
let block = SealedBlock { header, body };
consensus.validate_block_pre_execution(&block)?;
Ok(block)