mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-22 08:31:50 +01:00
style(mac): sort the layout rules with sort_by_key (clippy::unnecessary_sort_by)
window_manager.rs sorted (usize, Layout) pairs by their first field with a comparator closure; sort_by_key on the same field is the same stable sort.
No behaviour change. Pre-existing on the original macOS tip 9a58e511 (reported by cargo clippy --all-targets -D warnings on the Mini, stable 1.93).
Verified: fake-CC cargo clippy --locked --target aarch64-apple-darwin -p komorebi --all-targets -D warnings no longer reports this lint (the last hygiene revision records the whole run). Verified on the Mini: not yet.
This commit is contained in:
1 parent
d9837200c3
commit
f9f47f3fb4
1 file changed
+1
-1
@@ -3515,7 +3515,7 @@ impl WindowManager {
|
||||
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
||||
rules.retain(|pair| pair.0 != at_container_count);
|
||||
rules.push((at_container_count, Layout::Default(layout)));
|
||||
rules.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
rules.sort_by_key(|a| a.0);
|
||||
|
||||
// If this is the focused workspace on a non-focused screen, let's update it
|
||||
if focused_monitor_idx != monitor_idx && focused_workspace_idx == workspace_idx {
|
||||
|
||||
Reference in new issue
Block a user