From 768f126f1d6cc39d29792cb040a238e82533bf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Tue, 20 Aug 2019 14:51:14 +0200 Subject: [PATCH] use Status::* as @fdb-hiroshima suggested --- src/routes/blogs.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index a122ebff..e94c9fda 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -111,8 +111,8 @@ pub fn domain_validation( let value = validation_getter.get(&validation_id); if value.is_none() { - // don't know how to cast Status::NotFound to u16 - return Status::new(404, "validation id not found"); + // validation id not found + return Status::NotFound; } // we have valid id, now check the time @@ -122,8 +122,8 @@ pub fn domain_validation( // nope, expired (410: gone) if now.duration_since(*valid_until).as_secs() > 0 { validation_map.remove(&validation_id); - // don't know how to cast Status::Gone to u16 - return Custom(Status::Gone, "validation expired"); + // validation expired + return Status::Gone; } validation_map.remove(&validation_id);