CI clippy: 3 unnecessary_sort_by errors #27

Closed
opened 2026-05-12 15:50:03 +00:00 by zaelgohary · 1 comment
Member

cargo clippy --workspace -- -D warnings errors on:

  • crates/hero_agent/src/osis_store.rs:393
  • crates/hero_agent/src/osis_store.rs:612
  • crates/hero_agent_tools/src/suggest_tool.rs:98

Fix: .sort_by(|a, b| b.x.cmp(&a.x)).sort_by_key(|b| std::cmp::Reverse(b.x)).

`cargo clippy --workspace -- -D warnings` errors on: - `crates/hero_agent/src/osis_store.rs:393` - `crates/hero_agent/src/osis_store.rs:612` - `crates/hero_agent_tools/src/suggest_tool.rs:98` Fix: `.sort_by(|a, b| b.x.cmp(&a.x))` → `.sort_by_key(|b| std::cmp::Reverse(b.x))`.
Author
Member

Fixed in 724abb9 — applied clippy's suggested sort_by_key(|b| std::cmp::Reverse(...)) at all 3 sites.

Fixed in 724abb9 — applied clippy's suggested `sort_by_key(|b| std::cmp::Reverse(...))` at all 3 sites.
zaelgohary changed title from CI clippy: 3× unnecessary_sort_by errors (new lint in Rust 1.95) to CI clippy: 3 unnecessary_sort_by errors 2026-05-12 16:07:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_agent#27
No description provided.