From 3b6ea10cc0fde38a8819e05b338f9a3629c03ad6 Mon Sep 17 00:00:00 2001 From: Keith Mattix II Date: Fri, 21 Feb 2025 18:05:47 +0000 Subject: [PATCH] Run fmt Signed-off-by: Keith Mattix II --- src/sys/windows.rs | 8 ++++++-- tests/socket.rs | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sys/windows.rs b/src/sys/windows.rs index 9bd696f5..90dd489e 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -735,10 +735,14 @@ pub(crate) fn set_tcp_keepalive(socket: Socket, keepalive: &TcpKeepalive) -> io: keepaliveinterval: into_ms(keepalive.interval), }; - if let Some(retries) = keepalive.retries { unsafe { - setsockopt(socket, WinSock::IPPROTO_TCP, WinSock::TCP_KEEPCNT, retries as c_int)? + setsockopt( + socket, + WinSock::IPPROTO_TCP, + WinSock::TCP_KEEPCNT, + retries as c_int, + )? } } let mut out = 0; diff --git a/tests/socket.rs b/tests/socket.rs index 3776a4b4..8c9951ed 100644 --- a/tests/socket.rs +++ b/tests/socket.rs @@ -893,6 +893,7 @@ fn tcp_keepalive() { target_os = "netbsd", target_os = "tvos", target_os = "watchos", + target_os = "windows" ) ))] let params = params.with_retries(10); @@ -943,6 +944,7 @@ fn tcp_keepalive() { target_os = "netbsd", target_os = "tvos", target_os = "watchos", + target_os = "windows", ) ))] assert_eq!(socket.keepalive_retries().unwrap(), 10);