#![feature(proc_macro_hygiene, decl_macro)] #[macro_use] extern crate rocket; /// Doc Comment goes here I guess, I /// wonder how it handles multiple lines if it even does #[get("/hello//?&")] fn hello(name: String, age: u8, status: f64, gender: Option) -> String { format!( "Hello, {} {} year old {} named {}! ", gender, age, status, name ) } /// Describes a task /// and if completed #[derive(FromForm)] struct Task { description: Option, completed: bool, } #[post("/", data = "")] fn new(task: Form) -> Flash { if task.description.is_empty() { Flash::error(Redirect::to("/"), "Cannot be empty.") } else { Flash::success(Redirect::to("/"), "Task added.") } } fn main() { rocket::ignite().mount("/", routes![hello]).launch(); }