Skip to content

Commit 3b86ae3

Browse files
committedJul 11, 2024
Explicitly ignore into_raw_handle() using let _ = in sys/pal/windows.
1 parent 1cb5354 commit 3b86ae3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎std/src/sys/pal/windows/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ impl Stdio {
571571
Ok(io) => unsafe {
572572
let io = Handle::from_raw_handle(io);
573573
let ret = io.duplicate(0, true, c::DUPLICATE_SAME_ACCESS);
574-
io.into_raw_handle();
574+
let _ = io.into_raw_handle(); // Don't close the handle
575575
ret
576576
},
577577
// If no stdio handle is available, then propagate the null value.

‎std/src/sys/pal/windows/stdio.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn write(
101101
unsafe {
102102
let handle = Handle::from_raw_handle(handle);
103103
let ret = handle.write(data);
104-
handle.into_raw_handle(); // Don't close the handle
104+
let _ = handle.into_raw_handle(); // Don't close the handle
105105
return ret;
106106
}
107107
}
@@ -250,7 +250,7 @@ impl io::Read for Stdin {
250250
unsafe {
251251
let handle = Handle::from_raw_handle(handle);
252252
let ret = handle.read(buf);
253-
handle.into_raw_handle(); // Don't close the handle
253+
let _ = handle.into_raw_handle(); // Don't close the handle
254254
return ret;
255255
}
256256
}

0 commit comments

Comments
 (0)