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)) + } +}