Remove crate time

What the crate `time' did was simple enough to rewrite it easily
This commit is contained in:
2020-08-11 18:26:40 +02:00
parent 175b907afb
commit 4e2acb9682
4 changed files with 7 additions and 62 deletions

View File

@@ -129,13 +129,10 @@ impl BatteryState {
match time {
Some(e) => {
let time = e.value as u64;
let time = time::Time::try_from_hms(
(time / 3600) as u8,
((time % 3600) / 60) as u8,
(time % 60) as u8,
)
.unwrap();
time.to_string()
let hours = time / 3600;
let minutes = (time % 3600) / 60;
let seconds = time % 60;
format!("{:01}:{:02}:{:02}", hours, minutes, seconds)
}
None => {
eprintln!("Couldnt read remaining time");