Update rocket to 0.5
This commit is contained in:
1026
Cargo.lock
generated
1026
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
@ -19,15 +19,15 @@ semver = "0.11"
|
||||
uuid = { version = "0.7", features = ["serde", "v4"] }
|
||||
duplicate = "0.2"
|
||||
bincode = "1"
|
||||
handlebars = "1"
|
||||
handlebars = "3"
|
||||
|
||||
[dependencies.rocket]
|
||||
version = "0.4"
|
||||
#git = "https://github.com/SergioBenitez/Rocket"
|
||||
#branch = "master"
|
||||
#version = "0.4"
|
||||
git = "https://github.com/SergioBenitez/Rocket"
|
||||
branch = "master"
|
||||
|
||||
[dependencies.rocket_contrib]
|
||||
version = "0.4"
|
||||
#git = "https://github.com/SergioBenitez/Rocket"
|
||||
#branch = "master"
|
||||
#version = "0.4"
|
||||
git = "https://github.com/SergioBenitez/Rocket"
|
||||
branch = "master"
|
||||
features = ["handlebars_templates", "uuid"]
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#![feature(decl_macro)]
|
||||
mod database;
|
||||
mod handlebars_util;
|
||||
mod routes;
|
||||
@ -13,7 +12,8 @@ use rocket_contrib::serve::StaticFiles;
|
||||
use rocket_contrib::templates::Template;
|
||||
use std::{env, io};
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
#[rocket::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
dotenv().ok();
|
||||
|
||||
let db_path = env::var("DB_PATH").expect("DB_PATH not set");
|
||||
@ -59,7 +59,7 @@ fn main() -> io::Result<()> {
|
||||
],
|
||||
);
|
||||
|
||||
rocket.launch();
|
||||
rocket.launch().await.expect("rocket failed to launch");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -37,8 +37,8 @@ impl StatusJson {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r> Responder<'r> for StatusJson {
|
||||
fn respond_to(self, req: &Request) -> Result<Response<'r>, Status> {
|
||||
impl<'r> Responder<'r, 'static> for StatusJson {
|
||||
fn respond_to(self, req: &Request) -> Result<Response<'static>, Status> {
|
||||
if self.status.code >= 400 {
|
||||
warn!(
|
||||
"Responding with status {}.\n\
|
||||
|
||||
Reference in New Issue
Block a user