diff --git a/stackslib/src/burnchains/bitcoin/indexer.rs b/stackslib/src/burnchains/bitcoin/indexer.rs index 6081b0468e..687185e219 100644 --- a/stackslib/src/burnchains/bitcoin/indexer.rs +++ b/stackslib/src/burnchains/bitcoin/indexer.rs @@ -1100,8 +1100,10 @@ impl BurnchainIndexer for BitcoinIndexer { start_height: u64, end_height: Option, ) -> Result { - if end_height.is_some() && end_height <= Some(start_height) { - return Ok(end_height.unwrap()); + if let Some(end_height) = end_height { + if end_height <= start_height { + return Ok(end_height); + } } let new_height = self diff --git a/stackslib/src/burnchains/tests/db.rs b/stackslib/src/burnchains/tests/db.rs index c8f568b5bf..0b4e263c2c 100644 --- a/stackslib/src/burnchains/tests/db.rs +++ b/stackslib/src/burnchains/tests/db.rs @@ -59,7 +59,7 @@ impl BurnchainDB { let sql = "SELECT op FROM burnchain_db_block_ops WHERE block_hash = ?1"; let args = params![block_hash]; let mut ops: Vec = query_rows(&self.conn, sql, args)?; - ops.sort_by(|a, b| a.vtxindex().cmp(&b.vtxindex())); + ops.sort_by_key(|op| op.vtxindex()); Ok(ops) } diff --git a/stackslib/src/chainstate/nakamoto/tests/mod.rs b/stackslib/src/chainstate/nakamoto/tests/mod.rs index 0c242c0409..4a5af0cdd7 100644 --- a/stackslib/src/chainstate/nakamoto/tests/mod.rs +++ b/stackslib/src/chainstate/nakamoto/tests/mod.rs @@ -3049,7 +3049,7 @@ fn filter_one_transaction_per_signer_duplicate_nonces() { txs.clone(), ); let filtered_txs: Vec<_> = filtered_transactions.into_values().collect(); - txs.sort_by(|a, b| a.txid().cmp(&b.txid())); + txs.sort_by_key(|tx| tx.txid()); assert_eq!(filtered_txs.len(), 1); assert!(filtered_txs.contains(&txs.first().expect("failed to get first tx"))); }