Simplify some calculations

This commit is contained in:
Nathan Fisher 2024-02-09 10:59:09 -05:00
parent 559cfa3cb3
commit 43f39fe226

View File

@ -93,12 +93,11 @@ impl DateTime {
hour -= 1; hour -= 1;
} }
let hour = hour.try_into().unwrap(); let hour = hour.try_into().unwrap();
let mut minute: i8 = 60; let mut minute: i8 = 59;
while minute > 0 && seconds < -60 { while minute > 0 && seconds < -60 {
seconds += 60; seconds += 60;
minute -= 1; minute -= 1;
} }
minute -= 1;
let minute = minute.try_into().unwrap(); let minute = minute.try_into().unwrap();
let second: u8 = (seconds + 60).try_into().unwrap(); let second: u8 = (seconds + 60).try_into().unwrap();
Self { Self {