From b962ae132440dd88b9795313b2bddf161d9abb52 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Tue, 21 Nov 2023 23:42:51 +0000 Subject: [PATCH] duration_subsec calling `subsec_micros()` is more concise than this calculation --- library/std/src/sys/windows/net.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs index c29b863665f..6cd758ec5c3 100644 --- a/library/std/src/sys/windows/net.rs +++ b/library/std/src/sys/windows/net.rs @@ -162,7 +162,7 @@ impl Socket { let mut timeout = c::timeval { tv_sec: cmp::min(timeout.as_secs(), c_long::MAX as u64) as c_long, - tv_usec: (timeout.subsec_nanos() / 1000) as c_long, + tv_usec: timeout.subsec_micros() as c_long, }; if timeout.tv_sec == 0 && timeout.tv_usec == 0 {