Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Feb 5, 2024
1 parent 60d6145 commit 5192d59
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/db/db_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}

Expand Down

0 comments on commit 5192d59

Please sign in to comment.