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"]
5353libc = " 0.2.172"
5454
5555[target .'cfg(windows)' .dependencies .windows-sys ]
56- version = " 0.59 "
56+ version = " 0.60 "
5757features = [
5858 " Win32_Foundation" ,
5959 " Win32_Networking_WinSock" ,
Original file line number Diff line number Diff 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
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
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`.
101100const MAX_BUF_LEN : usize = c_int:: MAX as usize ;
You can’t perform that action at this time.
0 commit comments