Skip to content

Commit

Permalink
Fix blockchain/utils clippy warnings and cli.rs example
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Dec 1, 2020
1 parent 92f1fe5 commit 3a4edf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/blockchain/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ fn save_transaction_details_and_utxos<D: BatchDatabase>(
updates: &mut dyn BatchOperations,
utxo_deps: &HashMap<OutPoint, OutPoint>,
) -> 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;
Expand All @@ -338,7 +336,7 @@ fn save_transaction_details_and_utxos<D: BatchDatabase>(
// 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;
}

Expand Down Expand Up @@ -392,7 +390,7 @@ fn utxos_deps<D: BatchDatabase>(
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);
}
Expand Down
4 changes: 3 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
//!
//! # Example
//!
//! ```
//! ```no_run
//! use bdk::bitcoin::Network;
//! use bdk::blockchain::esplora::EsploraBlockchainConfig;
//! use bdk::blockchain::{AnyBlockchain, ConfigurableBlockchain};
Expand Down Expand Up @@ -71,6 +71,8 @@
//! None => AnyBlockchainConfig::Electrum(ElectrumBlockchainConfig {
//! url: cli_opt.electrum,
//! socks5: cli_opt.proxy,
//! retry: 10,
//! timeout: 10,
//! }),
//! };
//!
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// SOFTWARE.

// rustdoc will warn if there are missing docs
#![warn(missing_docs)]
// TODO #![warn(missing_docs)]
// only enables the `doc_cfg` feature when
// the `docsrs` configuration attribute is defined
#![cfg_attr(docsrs, feature(doc_cfg))]
Expand Down

0 comments on commit 3a4edf1

Please sign in to comment.