fix(file-ops): use sort_by_key to satisfy clippy 1.95 lint#238
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unbreaks CI after GitHub runners updated to Rust 1.95 stable, which introduced the
unnecessary_sort_byclippy lint.The problem
crates/file-ops/src/browse.rs:59was usingsort_bywith a case-insensitive comparator. Rust 1.95's new clippy flags this as replaceable with the lightersort_by_key. Since CI enforces-D warnings, every PR againstdevelopmentbreaks 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
Mechanical substitution suggested by clippy itself. Semantically identical: both sort case-insensitively by
entry.name.Test plan
cargo check -p capydeploy-file-opspasses locally