use Status::* as @fdb-hiroshima suggested

This commit is contained in:
Igor Galić 2019-08-20 14:51:14 +02:00
parent 169469816d
commit 768f126f1d
No known key found for this signature in database
GPG Key ID: ACFEFF7F6A123A86

View File

@ -111,8 +111,8 @@ pub fn domain_validation(
let value = validation_getter.get(&validation_id); let value = validation_getter.get(&validation_id);
if value.is_none() { if value.is_none() {
// don't know how to cast Status::NotFound to u16 // validation id not found
return Status::new(404, "validation id not found"); return Status::NotFound;
} }
// we have valid id, now check the time // we have valid id, now check the time
@ -122,8 +122,8 @@ pub fn domain_validation(
// nope, expired (410: gone) // nope, expired (410: gone)
if now.duration_since(*valid_until).as_secs() > 0 { if now.duration_since(*valid_until).as_secs() > 0 {
validation_map.remove(&validation_id); validation_map.remove(&validation_id);
// don't know how to cast Status::Gone to u16 // validation expired
return Custom(Status::Gone, "validation expired"); return Status::Gone;
} }
validation_map.remove(&validation_id); validation_map.remove(&validation_id);