Now compiles against rocket-0.5.0-rc.2

This commit is contained in:
Jeff Weiss
2023-01-06 15:30:01 -05:00
parent c5a9767881
commit bc2180d1e4
4 changed files with 30 additions and 29 deletions
+6 -7
View File
@@ -1,21 +1,20 @@
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
use rocket::response::content::Html;
use rocket::response::content::RawHtml;
use rocket::response::Redirect;
type Session<'a> = rocket_session::Session<'a, Vec<String>>;
fn main() {
rocket::ignite()
#[launch]
fn rocket() -> _ {
rocket::build()
.attach(Session::fairing())
.mount("/", routes![index, add, remove])
.launch();
}
#[get("/")]
fn index(session: Session) -> Html<String> {
fn index(session: Session) -> RawHtml<String> {
let mut page = String::new();
page.push_str(
r#"
@@ -38,7 +37,7 @@ fn index(session: Session) -> Html<String> {
}
});
page.push_str("</ul>");
Html(page)
RawHtml(page)
}
#[post("/add", data = "<dog>")]