mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-25 21:11:01 +00:00
use Status::* as @fdb-hiroshima suggested
This commit is contained in:
parent
169469816d
commit
768f126f1d
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue