summaryrefslogtreecommitdiff
path: root/src/time.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2022-01-17 13:55:07 -0500
committerBotahamec <botahamec@outlook.com>2022-01-17 13:55:07 -0500
commitdc115d47955d69cd97ce5afee378508c63ccb981 (patch)
tree0541701371c2074edfe6c46017187bc96edd398e /src/time.rs
parent25a361f50728b2612c96c63594eb920f7030c5f5 (diff)
naive date time
Diffstat (limited to 'src/time.rs')
-rw-r--r--src/time.rs10
1 files changed, 4 insertions, 6 deletions
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.