summaryrefslogtreecommitdiffstats
path: root/rust/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-23 16:08:47 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-24 15:21:32 -0700
commitb27f2317899f1d0fa2e02ade3bd9b3c396ae0685 (patch)
treea678f84a3d80e953312a98a030edbfecd3ea481c /rust/src
parent72b4f6a9258053267f8436b1548d9101220497a9 (diff)
downloadfatcat-b27f2317899f1d0fa2e02ade3bd9b3c396ae0685.tar.gz
fatcat-b27f2317899f1d0fa2e02ade3bd9b3c396ae0685.zip
use diesel::r2d2 instead of r2d2 directly
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 8069ad0b..dcefcdab 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -12,7 +12,6 @@ extern crate hyper;
#[macro_use]
extern crate error_chain;
extern crate iron;
-extern crate r2d2;
extern crate serde_json;
pub mod api_server;
@@ -42,7 +41,7 @@ use iron::middleware::AfterMiddleware;
use iron::{Request, Response};
use std::env;
-pub type ConnectionPool = r2d2::Pool<ConnectionManager<diesel::pg::PgConnection>>;
+pub type ConnectionPool = diesel::r2d2::Pool<ConnectionManager<diesel::pg::PgConnection>>;
/// Establish a direct database connection. Not currently used, but could be helpful for
/// single-threaded tests or utilities.
@@ -58,7 +57,7 @@ pub fn server() -> Result<api_server::Server> {
dotenv().ok();
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
let manager = ConnectionManager::<PgConnection>::new(database_url);
- let pool = r2d2::Pool::builder()
+ let pool = diesel::r2d2::Pool::builder()
.build(manager)
.expect("Failed to create database pool.");
Ok(api_server::Server { db_pool: pool })