File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ features = ["all"]
53
53
libc = " 0.2.172"
54
54
55
55
[target .'cfg(windows)' .dependencies .windows-sys ]
56
- version = " 0.59 "
56
+ version = " 0.60 "
57
57
features = [
58
58
" Win32_Foundation" ,
59
59
" Win32_Networking_WinSock" ,
Original file line number Diff line number Diff line change @@ -871,7 +871,7 @@ impl Socket {
871
871
pub fn keepalive ( & self ) -> io:: Result < bool > {
872
872
unsafe {
873
873
getsockopt :: < Bool > ( self . as_raw ( ) , sys:: SOL_SOCKET , sys:: SO_KEEPALIVE )
874
- . map ( |keepalive| keepalive != 0 )
874
+ . map ( |keepalive| keepalive != false as Bool )
875
875
}
876
876
}
877
877
@@ -2219,7 +2219,7 @@ impl Socket {
2219
2219
pub fn tcp_nodelay ( & self ) -> io:: Result < bool > {
2220
2220
unsafe {
2221
2221
getsockopt :: < Bool > ( self . as_raw ( ) , sys:: IPPROTO_TCP , sys:: TCP_NODELAY )
2222
- . map ( |nodelay| nodelay != 0 )
2222
+ . map ( |nodelay| nodelay != false as Bool )
2223
2223
}
2224
2224
}
2225
2225
Original file line number Diff line number Diff line change @@ -93,9 +93,8 @@ pub(crate) const SOL_SOCKET: c_int = windows_sys::Win32::Networking::WinSock::SO
93
93
/// NOTE: <https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockopt>
94
94
/// documents that options such as `TCP_NODELAY` and `SO_KEEPALIVE` expect a
95
95
/// `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 ;
99
98
100
99
/// Maximum size of a buffer passed to system call like `recv` and `send`.
101
100
const MAX_BUF_LEN : usize = c_int:: MAX as usize ;
You can’t perform that action at this time.
0 commit comments