Skip to content

Commit 50fc51e

Browse files
taiki-eThomasdezeeuw
authored andcommitted
Update windows-sys to 0.60
1 parent 3cc3b28 commit 50fc51e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ features = ["all"]
5353
libc = "0.2.172"
5454

5555
[target.'cfg(windows)'.dependencies.windows-sys]
56-
version = "0.59"
56+
version = "0.60"
5757
features = [
5858
"Win32_Foundation",
5959
"Win32_Networking_WinSock",

src/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl Socket {
871871
pub fn keepalive(&self) -> io::Result<bool> {
872872
unsafe {
873873
getsockopt::<Bool>(self.as_raw(), sys::SOL_SOCKET, sys::SO_KEEPALIVE)
874-
.map(|keepalive| keepalive != 0)
874+
.map(|keepalive| keepalive != false as Bool)
875875
}
876876
}
877877

@@ -2219,7 +2219,7 @@ impl Socket {
22192219
pub fn tcp_nodelay(&self) -> io::Result<bool> {
22202220
unsafe {
22212221
getsockopt::<Bool>(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_NODELAY)
2222-
.map(|nodelay| nodelay != 0)
2222+
.map(|nodelay| nodelay != false as Bool)
22232223
}
22242224
}
22252225

src/sys/windows.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ pub(crate) const SOL_SOCKET: c_int = windows_sys::Win32::Networking::WinSock::SO
9393
/// NOTE: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockopt>
9494
/// documents that options such as `TCP_NODELAY` and `SO_KEEPALIVE` expect a
9595
/// `BOOL` (alias for `c_int`, 4 bytes), however in practice this turns out to
96-
/// be false (or misleading) as a `BOOLEAN` (`c_uchar`, 1 byte) is returned by
97-
/// `getsockopt`.
98-
pub(crate) type Bool = windows_sys::Win32::Foundation::BOOLEAN;
96+
/// be false (or misleading) as a `bool` (1 byte) is returned by `getsockopt`.
97+
pub(crate) type Bool = bool;
9998

10099
/// Maximum size of a buffer passed to system call like `recv` and `send`.
101100
const MAX_BUF_LEN: usize = c_int::MAX as usize;

0 commit comments

Comments
 (0)