From 5192d59cc8f2e7b1785045efcc0cf7e96386b685 Mon Sep 17 00:00:00 2001 From: bkrmendy Date: Mon, 5 Feb 2024 22:25:39 +0100 Subject: [PATCH] clippy --- src/db/db_ops.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/db/db_ops.rs b/src/db/db_ops.rs index 97aec1c..1fcd2a2 100644 --- a/src/db/db_ops.rs +++ b/src/db/db_ops.rs @@ -205,13 +205,11 @@ impl DB for Persistence { [&hash], |row| Ok(Some(row.get(0).expect("No value in row"))), )?; - if block_data.is_none() { - bail!(DBError::Error("No block with hash found".to_owned())) + + if let Some(data) = block_data { + result.push(BlockRecord { hash, data }) } else { - result.push(BlockRecord { - hash, - data: block_data.unwrap(), - }) + bail!(DBError::Error("No block with hash found".to_owned())) } }