Skip to content

fix(file-ops): use sort_by_key to satisfy clippy 1.95 lint#238

Merged
lobinuxsoft merged 1 commit into
developmentfrom
fix/file-ops-clippy-1.95-sort-by
Apr 20, 2026
Merged

fix(file-ops): use sort_by_key to satisfy clippy 1.95 lint#238
lobinuxsoft merged 1 commit into
developmentfrom
fix/file-ops-clippy-1.95-sort-by

Conversation

@lobinuxsoft

Copy link
Copy Markdown
Owner

Summary

Unbreaks CI after GitHub runners updated to Rust 1.95 stable, which introduced the unnecessary_sort_by clippy lint.

The problem

crates/file-ops/src/browse.rs:59 was using sort_by with a case-insensitive comparator. Rust 1.95's new clippy flags this as replaceable with the lighter sort_by_key. Since CI enforces -D warnings, every PR against development breaks once the runner pulls 1.95.

Hit while trying to merge #237 — Rust Lint was the only failing check, even though that PR was a one-line submodule pointer bump.

The fix

- result.sort_by(|a, b| a.name.to_lowercase().cmp(&b.name.to_lowercase()));
+ result.sort_by_key(|entry| entry.name.to_lowercase());

Mechanical substitution suggested by clippy itself. Semantically identical: both sort case-insensitively by entry.name.

Test plan

…t_by lint

clippy 1.95 introduced `unnecessary_sort_by`, flagging the existing
`sort_by` call in browse.rs as replaceable with the lighter
`sort_by_key`. With `-D warnings` in CI this broke every PR against
development once GitHub runners updated to Rust 1.95 stable.

The suggested rewrite is semantically identical: both sort
case-insensitively by entry name.
@lobinuxsoft
lobinuxsoft merged commit 0ca3717 into development Apr 20, 2026
5 checks passed
@lobinuxsoft
lobinuxsoft deleted the fix/file-ops-clippy-1.95-sort-by branch April 20, 2026 19: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