Skip to content

Commit 5bc27ee

Browse files
committed
duration_subsec
calling `subsec_micros()` is more concise than this calculation
1 parent b679842 commit 5bc27ee

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/sys/windows

1 file changed

+1
-1
lines changed

library/std/src/sys/windows/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl Socket {
162162

163163
let mut timeout = c::timeval {
164164
tv_sec: cmp::min(timeout.as_secs(), c_long::MAX as u64) as c_long,
165-
tv_usec: (timeout.subsec_nanos() / 1000) as c_long,
165+
tv_usec: (timeout.subsec_micros()) as c_long,
166166
};
167167

168168
if timeout.tv_sec == 0 && timeout.tv_usec == 0 {

0 commit comments

Comments
 (0)