aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs7
1 files changed, 3 insertions, 4 deletions
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<ConnectionManager<PgConnection>>;
/// Initializes a database pool.
pub fn init_db_pool<'a>(dburl: &'a str) -> Pool {
- let config = r2d2::Config::default();
let manager = ConnectionManager::<PgConnection>::new(dburl);
- r2d2::Pool::new(config, manager).expect("db pool")
+ r2d2::Pool::builder().build(manager).expect("db pool")
}
use std::ops::Deref;