Skip to content

Commit feb450f

Browse files
authored
Merge pull request #5703 from stacks-network/fix/clippy-ci-unnecessary-sort-by
Fix clippy::unnecessary_sort_by throughout stacks core
2 parents c4ef003 + 9075887 commit feb450f

File tree

2 files changed

+2
-2
lines changed
  • stackslib/src

2 files changed

+2
-2
lines changed

stackslib/src/burnchains/tests/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl BurnchainDB {
5959
let sql = "SELECT op FROM burnchain_db_block_ops WHERE block_hash = ?1";
6060
let args = params![block_hash];
6161
let mut ops: Vec<BlockstackOperationType> = query_rows(&self.conn, sql, args)?;
62-
ops.sort_by(|a, b| a.vtxindex().cmp(&b.vtxindex()));
62+
ops.sort_by_key(|op| op.vtxindex());
6363
Ok(ops)
6464
}
6565

stackslib/src/chainstate/nakamoto/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,7 @@ fn filter_one_transaction_per_signer_duplicate_nonces() {
30493049
txs.clone(),
30503050
);
30513051
let filtered_txs: Vec<_> = filtered_transactions.into_values().collect();
3052-
txs.sort_by(|a, b| a.txid().cmp(&b.txid()));
3052+
txs.sort_by_key(|tx| tx.txid());
30533053
assert_eq!(filtered_txs.len(), 1);
30543054
assert!(filtered_txs.contains(&txs.first().expect("failed to get first tx")));
30553055
}

0 commit comments

Comments
 (0)