diff --git a/crates/brush-core-vendored/src/processes.rs b/crates/brush-core-vendored/src/processes.rs index 23fb1b9c3..5fd643ec4 100644 --- a/crates/brush-core-vendored/src/processes.rs +++ b/crates/brush-core-vendored/src/processes.rs @@ -47,7 +47,7 @@ impl ChildProcess { pgid: Option, ) -> Self { #[cfg(windows)] - let kill_handle = duplicate_handle(child.as_raw_handle()); + let kill_handle = child.raw_handle().and_then(duplicate_handle); Self { exec_future: Box::pin(child.wait_with_output()), @@ -201,8 +201,9 @@ impl Drop for ChildProcess { #[cfg(windows)] fn duplicate_handle(handle: RawHandle) -> Option { - use windows_sys::Win32::System::Threading::{ - DUPLICATE_SAME_ACCESS, DuplicateHandle, GetCurrentProcess, + use windows_sys::Win32::{ + Foundation::{DUPLICATE_SAME_ACCESS, DuplicateHandle}, + System::Threading::GetCurrentProcess, }; // SAFETY: GetCurrentProcess returns a pseudo-handle for the current process