Simplify some calculations
This commit is contained in:
parent
559cfa3cb3
commit
43f39fe226
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user