From 9ce975c2d1be1309dfded77fa9182be2baa9b30c Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 25 Nov 2026 20:18:56 +0800 Subject: [PATCH] fix(window): satisfy clippy and stub the new close commands in remote close e2e --- crates/ide-host/src/project.rs | 2 +- e2e/remoteClose.spec.ts | 3 +++ src-tauri/src/windows.rs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ide-host/src/project.rs b/crates/ide-host/src/project.rs index 36769e192..ecb9c49de 100644 --- a/crates/ide-host/src/project.rs +++ b/crates/ide-host/src/project.rs @@ -868,7 +868,7 @@ impl Host { return Ok(current); } self.close_project_detached(window); - if let Some(dir) = watch_dir.as_deref() { + if let Some(dir) = watch_dir { self.wait_detached_closes_for(dir); } let sink: SharedSink = (self.sink_for)(window); diff --git a/e2e/remoteClose.spec.ts b/e2e/remoteClose.spec.ts index 8aa8b63c7..4aebd8002 100644 --- a/e2e/remoteClose.spec.ts +++ b/e2e/remoteClose.spec.ts @@ -44,6 +44,9 @@ async function requestClose( idlePolicy: { overrideSeconds }, }); window.__ipc.handlers.window_close_context = () => ({ windows, quitting }); + window.__ipc.handlers.window_begin_prompt = () => true; + window.__ipc.handlers.window_end_prompt = () => null; + window.__ipc.handlers.window_ready_to_close = () => true; window.__ipc.handlers.close_project = () => null; window.__ipc.handlers.remote_invoke = ({ cmd }) => { if (cmd === "remote_idle_timeout_minutes") { diff --git a/src-tauri/src/windows.rs b/src-tauri/src/windows.rs index 8bf9ce8ee..fbde694e8 100644 --- a/src-tauri/src/windows.rs +++ b/src-tauri/src/windows.rs @@ -483,7 +483,7 @@ impl WindowsState { pub fn abort_all_closing(&self, initiator: Option<&str>) { { let mut close = self.close.lock(); - let mut targets: Vec = close.pending.drain(..).collect(); + let mut targets: Vec = std::mem::take(&mut close.pending); for label in close.ready.drain() { if !targets.iter().any(|l| l == &label) { targets.push(label);