summaryrefslogtreecommitdiff
path: root/src/sys/time.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/time.rs')
-rw-r--r--src/sys/time.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sys/time.rs b/src/sys/time.rs
index da65d516..a7240849 100644
--- a/src/sys/time.rs
+++ b/src/sys/time.rs
@@ -306,6 +306,8 @@ impl TimeValLike for TimeSpec {
})
}
+ // The cast is not unnecessary on all platforms.
+ #[allow(clippy::unnecessary_cast)]
fn num_seconds(&self) -> i64 {
if self.tv_sec() < 0 && self.tv_nsec() > 0 {
(self.tv_sec() + 1) as i64
@@ -322,6 +324,8 @@ impl TimeValLike for TimeSpec {
self.num_nanoseconds() / 1_000
}
+ // The cast is not unnecessary on all platforms.
+ #[allow(clippy::unnecessary_cast)]
fn num_nanoseconds(&self) -> i64 {
let secs = self.num_seconds() * 1_000_000_000;
let nsec = self.nanos_mod_sec();
@@ -549,6 +553,8 @@ impl TimeValLike for TimeVal {
})
}
+ // The cast is not unnecessary on all platforms.
+ #[allow(clippy::unnecessary_cast)]
fn num_seconds(&self) -> i64 {
if self.tv_sec() < 0 && self.tv_usec() > 0 {
(self.tv_sec() + 1) as i64
@@ -561,6 +567,8 @@ impl TimeValLike for TimeVal {
self.num_microseconds() / 1_000
}
+ // The cast is not unnecessary on all platforms.
+ #[allow(clippy::unnecessary_cast)]
fn num_microseconds(&self) -> i64 {
let secs = self.num_seconds() * 1_000_000;
let usec = self.micros_mod_sec();