From dc115d47955d69cd97ce5afee378508c63ccb981 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Mon, 17 Jan 2022 13:55:07 -0500 Subject: naive date time --- src/time.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/time.rs') diff --git a/src/time.rs b/src/time.rs index 6981c94..94f7cd8 100644 --- a/src/time.rs +++ b/src/time.rs @@ -1,5 +1,3 @@ -use std::ops::Add; - #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct Time { hour: u8, @@ -107,14 +105,14 @@ impl Time { // Get the millisecond within the second. // The returned value will always be in the range `0..1_000` - pub const fn millisecond(self) -> u8 { - (self.nanosecond / 1_000_000) as u8 + pub const fn millisecond(self) -> u16 { + (self.nanosecond / 1_000_000) as u16 } // Get the microsecond within the second. // The returned value will always be in the range `0..1_000_000` - pub const fn microsecond(self) -> u8 { - (self.nanosecond / 1_000) as u8 + pub const fn microsecond(self) -> u32 { + (self.nanosecond / 1_000) as u32 } // Get the nanosecond within the second. -- cgit v1.2.3