Skip to content

Commit

Permalink
Explicitly ignore into_raw_handle() using let _ = in sys/pal/wind…
Browse files Browse the repository at this point in the history
…ows.
  • Loading branch information
zachs18 committed Jul 11, 2024
1 parent 1cb5354 commit 3b86ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion std/src/sys/pal/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ impl Stdio {
Ok(io) => unsafe {
let io = Handle::from_raw_handle(io);
let ret = io.duplicate(0, true, c::DUPLICATE_SAME_ACCESS);
io.into_raw_handle();
let _ = io.into_raw_handle(); // Don't close the handle
ret
},
// If no stdio handle is available, then propagate the null value.
Expand Down
4 changes: 2 additions & 2 deletions std/src/sys/pal/windows/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn write(
unsafe {
let handle = Handle::from_raw_handle(handle);
let ret = handle.write(data);
handle.into_raw_handle(); // Don't close the handle
let _ = handle.into_raw_handle(); // Don't close the handle
return ret;
}
}
Expand Down Expand Up @@ -250,7 +250,7 @@ impl io::Read for Stdin {
unsafe {
let handle = Handle::from_raw_handle(handle);
let ret = handle.read(buf);
handle.into_raw_handle(); // Don't close the handle
let _ = handle.into_raw_handle(); // Don't close the handle
return ret;
}
}
Expand Down

0 comments on commit 3b86ae3

Please sign in to comment.