Skip to content

fix(lib): replace sort_by with sort_by_key for clippy 1.95#133

Merged
emal-avala merged 2 commits intomainfrom
fix/clippy-unnecessary-sort-by
Apr 16, 2026
Merged

fix(lib): replace sort_by with sort_by_key for clippy 1.95#133
emal-avala merged 2 commits intomainfrom
fix/clippy-unnecessary-sort-by

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

Rust 1.95's unnecessary_sort_by clippy lint rejects sort_by(|a, b| b.X.cmp(&a.X)) in favor of sort_by_key(|x| std::cmp::Reverse(x.X)). Four violations were breaking the Clippy job in CI on `main`.

Files touched:

  • `crates/lib/src/memory/scanner.rs` (x2)
  • `crates/lib/src/tools/glob.rs`
  • `crates/lib/src/tools/tool_search.rs`

Test plan

  • CI Clippy job passes
  • Behavior preserved: each call sorts descending (newest / highest score first)

Rust 1.95's unnecessary_sort_by lint rejects `sort_by(|a, b| b.X.cmp(&a.X))`
in favor of `sort_by_key(|x| std::cmp::Reverse(x.X))`. Fixes four violations
breaking CI's Clippy job on main.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Clippy 1.95's collapsible_match lint rejects a match arm whose body is a
single `if`. Semantically equivalent because the outer match has a `_ => {}`
catch-all — when the guard is false, Event::End(TagEnd::Item) hits that
no-op arm instead.
@emal-avala emal-avala merged commit c641aa6 into main Apr 16, 2026
13 of 14 checks passed
@emal-avala emal-avala deleted the fix/clippy-unnecessary-sort-by branch April 16, 2026 16:26
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