From 337c9d2b2280f8e252e8c9acd7e73caf1291d7a5 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 18 Jan 2018 20:11:07 +0100 Subject: Upgrade to Diesel 1.1 and r2d2 0.8.2. Also drop the now obsolete diesel_codegen crate. --- src/utils/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/utils') diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 495440a..57975bc 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,16 +1,15 @@ -use diesel::pg::PgConnection; -use std::fmt::Display; +use diesel::PgConnection; use r2d2; use r2d2_diesel::ConnectionManager; +use std::fmt::Display; // An alias to the type for a pool of Diesel PostgreSql connections. type Pool = r2d2::Pool>; /// Initializes a database pool. pub fn init_db_pool<'a>(dburl: &'a str) -> Pool { - let config = r2d2::Config::default(); let manager = ConnectionManager::::new(dburl); - r2d2::Pool::new(config, manager).expect("db pool") + r2d2::Pool::builder().build(manager).expect("db pool") } use std::ops::Deref; -- cgit v1.2.3