Skip to content

fix(clippy): use sort_by_key with Reverse for descending sort - #7

Merged
mateodelnorte merged 1 commit into
mainfrom
meta-git-lib-clippy
Apr 26, 2026
Merged

mateodelnorte merged 1 commit into
mainfrom
meta-git-lib-clippy

Conversation

@mateodelnorte

Copy link
Copy Markdown
Contributor

Caught by Rust 1.95.0's unnecessary_sort_by lint. Same pattern as gitkb/meta_cli#23sort_by(|a, b| b.cmp(&a)) is equivalent to sort_by_key(|x| std::cmp::Reverse(x)). DateTime<Utc> is Copy, so no allocation/clone concerns. Unblocks gitkb/meta#78.

Caught by Rust 1.95.0's unnecessary_sort_by lint. Same pattern as
gitkb/meta_cli#23 — `sort_by(|a, b| b.cmp(&a))` is equivalent to
`sort_by_key(|x| std::cmp::Reverse(x))`. DateTime<Utc> is Copy, so
no allocation/clone concerns.

Unblocks gitkb/meta#78.
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@mateodelnorte has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c3e3a958-e0ff-4c9d-b023-3bc5a1206a89

📥 Commits

Reviewing files that changed from the base of the PR and between 61fb53e and 5efef3d.

📒 Files selected for processing (1)
  • src/snapshot.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch meta-git-lib-clippy

Comment @coderabbitai help to get the list of available commands and usage tips.

@mateodelnorte
mateodelnorte merged commit cf435ac into main Apr 26, 2026
7 checks passed
@mateodelnorte
mateodelnorte deleted the meta-git-lib-clippy branch April 26, 2026 21:31
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.

1 participant