Skip to content

Resolve clippy lint in peer ranking sort#29

Merged
Nugine merged 2 commits intomainfrom
copilot/fix-ci-failure
Jan 25, 2026
Merged

Resolve clippy lint in peer ranking sort#29
Nugine merged 2 commits intomainfrom
copilot/fix-ci-failure

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

CI was failing on a clippy::unnecessary_sort_by lint in the epaxos peers ranking code. This update removes the lint by using the key-based sort API.

  • Peer rank sorting
    • Swap the comparator-based sort with a key-based sort for the same ordering.
fn sort_rank(rank: &mut [(u64, ReplicaId)]) {
    rank.sort_unstable_by_key(|lhs| lhs.0);
}
Original prompt

fix CI failure


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI failure in build process Resolve clippy lint in peer ranking sort Jan 25, 2026
Copilot AI requested a review from Nugine January 25, 2026 13:35
@Nugine Nugine marked this pull request as ready for review January 25, 2026 13:46
Copilot AI review requested due to automatic review settings January 25, 2026 13:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates EPaxos peer ranking to satisfy clippy::unnecessary_sort_by by switching from a comparator-based sort to a key-based sort, preserving the same ordering behavior.

Changes:

  • Replace sort_unstable_by(|lhs, rhs| ...) with sort_unstable_by_key(|lhs| ...) in peer rank sorting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nugine Nugine merged commit e4dbe49 into main Jan 25, 2026
7 checks passed
@Nugine Nugine deleted the copilot/fix-ci-failure branch January 25, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants