bugfix on enum for status

This commit is contained in:
2020-11-25 22:59:41 +01:00
parent 085973963a
commit 6b6919fed2

View File

@@ -38,8 +38,8 @@ struct Cli {
#[derive(Debug)] #[derive(Debug)]
enum Status { enum Status {
Idle, Idle,
Warn, Warning,
Crit, Critical,
} }
fn get_status(events: Vec<NaiveDateTime>, w: i64, c: i64) -> Result<Status, String> { fn get_status(events: Vec<NaiveDateTime>, w: i64, c: i64) -> Result<Status, String> {
@@ -55,10 +55,10 @@ fn get_status(events: Vec<NaiveDateTime>, w: i64, c: i64) -> Result<Status, Stri
if event_remaining >= 0 { if event_remaining >= 0 {
if event_remaining <= w { if event_remaining <= w {
state = Status::Warn; state = Status::Warning;
} }
if event_remaining <= c { if event_remaining <= c {
state = Status::Crit; state = Status::Critical;
} }
} }
} }