Skip to content

Commit

Permalink
Merge pull request #5703 from stacks-network/fix/clippy-ci-unnecessar…
Browse files Browse the repository at this point in the history
…y-sort-by

Fix clippy::unnecessary_sort_by throughout stacks core
  • Loading branch information
jferrant authored Jan 15, 2025
2 parents c4ef003 + 9075887 commit 7cf6ccd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stackslib/src/burnchains/tests/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockstackOperationType> = 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)
}

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/chainstate/nakamoto/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
Expand Down

0 comments on commit 7cf6ccd

Please sign in to comment.