Skip to content

Commit 89e3f66

Browse files
committed
Use r2d2 0.8
1 parent 05c6ff2 commit 89e3f66

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ semver = "0.9"
2020
slug = "=0.1.1"
2121
env_logger = "0.4"
2222
magic = "0.12"
23-
r2d2 = "0.7"
24-
r2d2_postgres = "0.13"
23+
r2d2 = "0.8"
24+
r2d2_postgres = "0.14"
2525
url = "1.4"
2626
libc = "0.2"
2727
badge = { version = "0", path = "src/web/badge" }

src/db/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ pub fn connect_db() -> Result<Connection, Error> {
2626
pub fn create_pool() -> r2d2::Pool<r2d2_postgres::PostgresConnectionManager> {
2727
let db_url = env::var("CRATESFYI_DATABASE_URL")
2828
.expect("CRATESFYI_DATABASE_URL environment variable is not exists");
29-
let config = r2d2::Config::default();
3029
let manager = r2d2_postgres::PostgresConnectionManager::new(&db_url[..],
3130
r2d2_postgres::TlsMode::None)
3231
.expect("Failed to create PostgresConnectionManager");
33-
r2d2::Pool::new(config, manager).expect("Failed to create r2d2 pool")
32+
r2d2::Pool::builder().build(manager).expect("Failed to create r2d2 pool")
3433
}
3534

3635

0 commit comments

Comments
 (0)