From 552ab43701d8ccddc86dbc848491863e7bbfa855 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:12:30 -0700 Subject: [PATCH] style(mac): take the workspaces with mem::take instead of drain(..).collect() (clippy::drain_collect) monitor.rs remove_workspaces moved every workspace into a new VecDeque through drain; mem::take moves the whole deque and leaves an empty one, which is the same result without the second allocation. 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 (see the last hygiene revision for the whole run). Verified on the Mini: not yet. --- komorebi-for-mac/komorebi/src/monitor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi-for-mac/komorebi/src/monitor.rs b/komorebi-for-mac/komorebi/src/monitor.rs index 5703086d..47713613 100644 --- a/komorebi-for-mac/komorebi/src/monitor.rs +++ b/komorebi-for-mac/komorebi/src/monitor.rs @@ -577,7 +577,7 @@ impl Monitor { } pub fn remove_workspaces(&mut self) -> VecDeque { - self.workspaces_mut().drain(..).collect() + std::mem::take(self.workspaces_mut()) } pub fn ensure_workspace_count(&mut self, ensure_count: usize) {