make rustdoc shut up about winapi's switched out types for docs

This commit is contained in:
Josh Junon 2024-03-21 19:52:14 +01:00
parent 67f46e7a36
commit 4c61ddc40f
No known key found for this signature in database
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
//! A [Tokio](https://tokio.rs)-based [`super::GitExecutor`] implementation.
//! A [Tokio](https://tokio.rs)-based Git executor implementation.
#[cfg(unix)]
mod unix;
@ -13,7 +13,7 @@ pub use self::unix::TokioAskpassServer;
#[cfg(windows)]
pub use self::windows::TokioAskpassServer;
/// A [`super::GitExecutor`] implementation using the `git` command-line tool
/// A Git executor implementation using the `git` command-line tool
/// via [`tokio::process::Command`].
pub struct TokioExecutor;

View File

@ -21,8 +21,14 @@ impl Socket for BufStream<NamedPipeServer> {
let mut out_pid: winapi::shared::minwindef::ULONG = 0;
#[allow(unsafe_code)]
let r =
unsafe { winapi::um::winbase::GetNamedPipeClientProcessId(raw_handle, &mut out_pid) };
let r = unsafe {
winapi::um::winbase::GetNamedPipeClientProcessId(
// We need the `as` here to make rustdoc shut up
// about winapi using different type defs for docs.
raw_handle as winapi::um::winnt::HANDLE,
&mut out_pid,
)
};
if r == 0 {
Err(std::io::Error::last_os_error())