duration_subsec

calling `subsec_micros()` is more concise than this calculation
This commit is contained in:
Chris Denton 2023-11-21 23:42:51 +00:00
parent 9e42456a0d
commit b962ae1324
No known key found for this signature in database
GPG key ID: 713472F2F45627DE

View file

@ -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 {