aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-01-18 20:11:07 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-01-18 20:11:07 +0100
commit337c9d2b2280f8e252e8c9acd7e73caf1291d7a5 (patch)
tree9468fa1820970e846ef4868f0ec2dba655b81679 /src/utils
parente96c58580b2ac1874718f3d31a1d4abcdcc6dbb6 (diff)
downloadrocket-blog-337c9d2b2280f8e252e8c9acd7e73caf1291d7a5.tar.gz
rocket-blog-337c9d2b2280f8e252e8c9acd7e73caf1291d7a5.tar.bz2
rocket-blog-337c9d2b2280f8e252e8c9acd7e73caf1291d7a5.zip
Upgrade to Diesel 1.1 and r2d2 0.8.2.
Also drop the now obsolete diesel_codegen crate.
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;