From f9f47f3fb4b6655a82214103dd46426ce13b5a79 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 12:37:18 -0700 Subject: [PATCH] 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. --- komorebi-for-mac/komorebi/src/window_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi-for-mac/komorebi/src/window_manager.rs b/komorebi-for-mac/komorebi/src/window_manager.rs index 48d66dac..e9dc083b 100644 --- a/komorebi-for-mac/komorebi/src/window_manager.rs +++ b/komorebi-for-mac/komorebi/src/window_manager.rs @@ -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 {