From b27f2317899f1d0fa2e02ade3bd9b3c396ae0685 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 23 May 2018 16:08:47 -0700 Subject: use diesel::r2d2 instead of r2d2 directly --- rust/Cargo.lock | 1 - rust/Cargo.toml | 1 - rust/src/lib.rs | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'rust') diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 6d3b6e1f..21c65be1 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -301,7 +301,6 @@ dependencies = [ "iron 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "iron-slog 0.0.1 (git+https://github.com/bnewbold/iron-slog?branch=bnewbold-iron-0.6)", "iron-test 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "r2d2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ee078629..0fda6950 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -12,7 +12,6 @@ diesel = { version = "1.2", features = ["postgres", "uuid", "serde_json", "chron dotenv = "0.9.0" clap = "*" error-chain = "0.11" -r2d2 = "0.8" uuid = "0.5" # API server 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>; +pub type ConnectionPool = diesel::r2d2::Pool>; /// 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 { dotenv().ok(); let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set"); let manager = ConnectionManager::::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 }) -- cgit v1.2.3