From e7beaa60f8c246190a8d9089c66d546abadab577 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 4 Nov 2019 10:10:16 -0500 Subject: need to perform this multiplication as u64 otherwise it can overflow the u32 before calling u64::from --- src/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 02f2178..7acbbe9 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -8,9 +8,9 @@ struct Header { impl Header { fn time(&self) -> std::time::Duration { - std::time::Duration::from_micros(u64::from( - self.secs * 1_000_000 + self.micros, - )) + std::time::Duration::from_micros( + u64::from(self.secs) * 1_000_000 + u64::from(self.micros), + ) } fn len(&self) -> usize { -- cgit v1.2.3