From 59482f795b06fd5931aaf1c91c1b55fcc76ae110 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Tue, 1 Dec 2020 14:36:15 +0100 Subject: [PATCH] [blockchain] Fix clippy warnings --- src/blockchain/utils.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/blockchain/utils.rs b/src/blockchain/utils.rs index 8fb0f342..3d7a3d98 100644 --- a/src/blockchain/utils.rs +++ b/src/blockchain/utils.rs @@ -310,9 +310,7 @@ fn save_transaction_details_and_utxos( updates: &mut dyn BatchOperations, utxo_deps: &HashMap, ) -> Result<(), Error> { - let tx = db - .get_raw_tx(txid)? - .ok_or_else(|| Error::TransactionNotFound)?; + let tx = db.get_raw_tx(txid)?.ok_or(Error::TransactionNotFound)?; let mut incoming: u64 = 0; let mut outgoing: u64 = 0; @@ -338,7 +336,7 @@ fn save_transaction_details_and_utxos( // The input is not ours, but we still need to count it for the fees let tx = db .get_raw_tx(&input.previous_output.txid)? - .ok_or_else(|| Error::TransactionNotFound)?; + .ok_or(Error::TransactionNotFound)?; inputs_sum += tx.output[input.previous_output.vout as usize].value; } @@ -392,7 +390,7 @@ fn utxos_deps( for utxo in utxos { let from_tx = tx_raw_in_db .get(&utxo.outpoint.txid) - .ok_or_else(|| Error::TransactionNotFound)?; + .ok_or(Error::TransactionNotFound)?; for input in from_tx.input.iter() { utxos_deps.insert(input.previous_output, utxo.outpoint); }