Rocket should manage DbConn, not Option<DbConn>

Otherwise it fails when using DbConn as a request guard
This commit is contained in:
Bat 2018-10-08 20:02:17 +01:00
parent 4f84b2a3ed
commit 3b7842d040

View file

@ -56,7 +56,7 @@ fn init_pool() -> Option<DbPool> {
} }
fn main() { fn main() {
let pool = init_pool(); let pool = init_pool().expect("Couldn't intialize database pool");
rocket::ignite() rocket::ignite()
.mount("/", routes![ .mount("/", routes![
routes::blogs::paginated_details, routes::blogs::paginated_details,