From b3d94d9c93bd5d0dce7b8ebda4719aaf97845e2d Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 12 Oct 2021 22:58:38 +0300 Subject: [PATCH] fix: impl error for r2d2_postgres --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/error.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 307bf5a..23a08cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -493,7 +493,7 @@ checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "ood_persistence" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-trait", "bb8", diff --git a/Cargo.toml b/Cargo.toml index e5cee0b..c7dcf43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ood_persistence" -version = "0.1.0" +version = "0.1.1" edition = "2018" authors = ["Dmitriy Pleshevskiy "] repository = "https://github.com/pleshevskiy/ood_persistence" diff --git a/src/error.rs b/src/error.rs index 9d171a6..0d706b7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -34,3 +34,10 @@ impl From for PersistenceError { Self::DbError(Box::new(err)) } } + +#[cfg(all(feature = "r2d2_postgres", not(feature = "bb8_postgres")))] +impl From for PersistenceError { + fn from(err: r2d2_postgres::postgres::Error) -> Self { + Self::DbError(Box::new(err)) + } +}