about summary refs log tree commit diff
path: root/library/std/src/sys/windows/net.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/windows/net.rs')
-rw-r--r--library/std/src/sys/windows/net.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs
index 1ad4f0c70a3..33152cc97ab 100644
--- a/library/std/src/sys/windows/net.rs
+++ b/library/std/src/sys/windows/net.rs
@@ -449,7 +449,7 @@ impl Socket {
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = c::linger {
             l_onoff: linger.is_some() as c_ushort,
-            l_linger: linger.map(|dur| dur.as_secs() as c_ushort).unwrap_or_default(),
+            l_linger: linger.unwrap_or_default().as_secs() as c_ushort,
         };
 
         net::setsockopt(self, c::SOL_SOCKET, c::SO_LINGER, linger)