From 015edc13c1f8d0c9e56c775566f80cec28edd35f Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Thu, 2 Jun 2022 13:14:14 -0400 Subject: [PATCH] Refactor and clean up. --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 81d9857..1a49057 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use tide::{Request, Response}; +use tide::{http::StatusCode, Request, Response}; #[async_std::main] async fn main() -> tide::Result<()> { @@ -14,7 +14,7 @@ async fn app_setup() -> tide::Server<()> { } async fn home(_req: Request<()>) -> tide::Result { - let mut res = Response::new(200); + let mut res = Response::new(StatusCode::Ok); res.set_body(" @@ -36,6 +36,6 @@ mod basic_tests { async fn home_page_available() { let app = app_setup().await; let response = app.get("/").await.unwrap(); - assert_eq!(response.status(), tide::http::StatusCode::Ok); + assert_eq!(response.status(), StatusCode::Ok); } }