From f2452bd9d69ff197465303e35a2199de7984474d Mon Sep 17 00:00:00 2001 From: Curly Bryce Date: Tue, 2 Jul 2024 19:20:52 -0600 Subject: remove test code --- src/main.rs | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c3fcf91..859c4d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -110,27 +110,6 @@ impl DB { } } -#[derive(Debug, Serialize)] -struct TextResponse { - message: String -} -impl From<&'static str> for TextResponse { - fn from(value: &'static str) -> Self { - TextResponse{message: value.into()} - } -} - -#[derive(Debug, Deserialize)] -struct InputForm { - user: String, - password: String, -} -impl InputForm { - pub fn login(&self) -> bool { - self.user == self.password - } -} - #[get("/")] async fn index() -> &'static str { "This is a POKO server" @@ -179,17 +158,7 @@ async fn new_user(data: Json, db: &State>) -> Json) -> Json { - println!("{:?}", body); - if body.login() { - TextResponse::from("Equal").into() - } else { - TextResponse::from("Not Equal").into() - } -} - #[launch] fn rocket() -> _ { - rocket::build().manage(Mutex::new(DB::load())).mount("/", routes![index, posttest, new_user, get_user]) + rocket::build().manage(Mutex::new(DB::load())).mount("/", routes![index, new_user, get_user]) } \ No newline at end of file -- cgit v1.2.3