diff --git a/src/time.rs b/src/time.rs index 903b0040f9..8b7e6dcea4 100644 --- a/src/time.rs +++ b/src/time.rs @@ -28,7 +28,7 @@ impl timeval { u64::try_from(self.tv_sec) .ok() .and_then(|secs| secs.checked_mul(1_000_000)) - .and_then(|millions| millions.checked_add(u64::try_from(self.tv_usec).ok()?)) + .and_then(|millions| millions.checked_add(u64::from(self.tv_usec))) } } @@ -62,7 +62,7 @@ impl timespec { u64::try_from(self.tv_sec) .ok() .and_then(|secs| secs.checked_mul(1_000_000)) - .and_then(|millions| millions.checked_add(u64::try_from(self.tv_nsec).ok()? / 1000)) + .and_then(|millions| millions.checked_add(u64::from(self.tv_nsec) / 1000)) } }