X-Git-Url: http://git.euphorik.ch/?p=recipes.git;a=blobdiff_plain;f=backend%2Fsrc%2Fmain.rs;h=daeed7afe7f280872d1b1c5a6d674bcf960d0f2d;hp=037650771f26c9fe8e2d0c2db0fbc7273a5961e8;hb=a080d19cb9076780db9e86325b2ab617886e2a5f;hpb=e2e54b8f43015738af860b005825dc809f5275ab diff --git a/backend/src/main.rs b/backend/src/main.rs index 0376507..daeed7a 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -39,7 +39,6 @@ async fn home_page(req: HttpRequest) -> impl Responder { #[get("/recipe/view/{id}")] async fn view_page(req: HttpRequest, path: web::Path<(i32,)>) -> impl Responder { - panic!("ERROR"); ViewRecipeTemplate { recipes: vec![ db::Recipe { title: String::from("Saumon en croûte feuilletée"), id: 1 }, db::Recipe { title: String::from("Croissant au jambon"), id: 2 } ], current_recipe: db::Recipe { title: String::from("Saumon en croûte feuilletée"), id: 1 } } } @@ -108,7 +107,10 @@ fn process_args() -> bool { print_usage(); return true } else if args.iter().any(|arg| arg == "--test") { - let db_connection = db::Connection::new(); + match db::Connection::new() { + Ok(_) => (), + Err(error) => println!("Error: {:?}", error) + } return true }