Skip to content

Commit 287e380

Browse files
authored
Merge pull request #129 from SergioBenitez/deadpool-upgrade
Update deadpool to 0.10
2 parents f203e6d + b413db6 commit 287e380

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mysql_async = { version = ">=0.30.0,<0.33", optional = true}
2323
mysql_common = {version = ">=0.29.0,<0.31.0", optional = true}
2424

2525
bb8 = {version = "0.8", optional = true}
26-
deadpool = {version = "0.9", optional = true}
26+
deadpool = {version = "0.10", optional = true}
2727
mobc = {version = ">=0.7,<0.9", optional = true}
2828
scoped-futures = {version = "0.1", features = ["std"]}
2929

@@ -58,4 +58,3 @@ members = [
5858
"examples/postgres/pooled-with-rustls",
5959
"examples/postgres/run-pending-migrations-with-rustls",
6060
]
61-

src/pooled_connection/deadpool.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub type Pool<C> = deadpool::managed::Pool<AsyncDieselConnectionManager<C>>;
4848
/// Type alias for using [`deadpool::managed::PoolBuilder`] with [`diesel-async`]
4949
pub type PoolBuilder<C> = deadpool::managed::PoolBuilder<AsyncDieselConnectionManager<C>>;
5050
/// Type alias for using [`deadpool::managed::BuildError`] with [`diesel-async`]
51-
pub type BuildError = deadpool::managed::BuildError<super::PoolError>;
51+
pub type BuildError = deadpool::managed::BuildError;
5252
/// Type alias for using [`deadpool::managed::PoolError`] with [`diesel-async`]
5353
pub type PoolError = deadpool::managed::PoolError<super::PoolError>;
5454
/// Type alias for using [`deadpool::managed::Object`] with [`diesel-async`]
@@ -57,8 +57,6 @@ pub type Object<C> = deadpool::managed::Object<AsyncDieselConnectionManager<C>>;
5757
pub type Hook<C> = deadpool::managed::Hook<AsyncDieselConnectionManager<C>>;
5858
/// Type alias for using [`deadpool::managed::HookError`] with [`diesel-async`]
5959
pub type HookError = deadpool::managed::HookError<super::PoolError>;
60-
/// Type alias for using [`deadpool::managed::HookErrorCause`] with [`diesel-async`]
61-
pub type HookErrorCause = deadpool::managed::HookErrorCause<super::PoolError>;
6260

6361
#[async_trait::async_trait]
6462
impl<C> Manager for AsyncDieselConnectionManager<C>
@@ -78,7 +76,11 @@ where
7876
.map_err(super::PoolError::ConnectionError)
7977
}
8078

81-
async fn recycle(&self, obj: &mut Self::Type) -> deadpool::managed::RecycleResult<Self::Error> {
79+
async fn recycle(
80+
&self,
81+
obj: &mut Self::Type,
82+
_: &deadpool::managed::Metrics,
83+
) -> deadpool::managed::RecycleResult<Self::Error> {
8284
if std::thread::panicking() || obj.is_broken() {
8385
return Err(deadpool::managed::RecycleError::StaticMessage(
8486
"Broken connection",

0 commit comments

Comments
 (0)