Skip to content

Commit c482d59

Browse files
jrandolfweiznich
authored andcommitted
Update deadpool to 0.11
1 parent 1bd4d53 commit c482d59

File tree

2 files changed

+49
-18
lines changed

2 files changed

+49
-18
lines changed

Cargo.toml

+47-15
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,52 @@ description = "An async extension for Diesel the safe, extensible ORM and Query
1313
rust-version = "1.65.0"
1414

1515
[dependencies]
16-
diesel = { version = "~2.1.1", default-features = false, features = ["i-implement-a-third-party-backend-and-opt-into-breaking-changes"]}
16+
diesel = { version = "~2.1.1", default-features = false, features = [
17+
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
18+
] }
1719
async-trait = "0.1.66"
18-
futures-channel = { version = "0.3.17", default-features = false, features = ["std", "sink"], optional = true }
19-
futures-util = { version = "0.3.17", default-features = false, features = ["std", "sink"] }
20-
tokio-postgres = { version = "0.7.10", optional = true}
21-
tokio = { version = "1.26", optional = true}
22-
mysql_async = { version = ">=0.30.0,<0.34", optional = true, default-features = false, features = ["minimal", "derive"] }
23-
mysql_common = {version = ">=0.29.0,<0.32.0", optional = true, default-features = false, features = ["frunk", "derive"]}
20+
futures-channel = { version = "0.3.17", default-features = false, features = [
21+
"std",
22+
"sink",
23+
], optional = true }
24+
futures-util = { version = "0.3.17", default-features = false, features = [
25+
"std",
26+
"sink",
27+
] }
28+
tokio-postgres = { version = "0.7.10", optional = true }
29+
tokio = { version = "1.26", optional = true }
30+
mysql_async = { version = ">=0.30.0,<0.34", optional = true, default-features = false, features = [
31+
"minimal",
32+
"derive",
33+
] }
34+
mysql_common = { version = ">=0.29.0,<0.32.0", optional = true, default-features = false, features = [
35+
"frunk",
36+
"derive",
37+
] }
2438

25-
bb8 = {version = "0.8", optional = true}
26-
deadpool = {version = "0.10", optional = true, default-features = false, features = ["managed"] }
27-
mobc = {version = ">=0.7,<0.10", optional = true}
28-
scoped-futures = {version = "0.1", features = ["std"]}
39+
bb8 = { version = "0.8", optional = true }
40+
deadpool = { version = "0.11", optional = true, default-features = false, features = [
41+
"managed",
42+
] }
43+
mobc = { version = ">=0.7,<0.10", optional = true }
44+
scoped-futures = { version = "0.1", features = ["std"] }
2945

3046
[dev-dependencies]
31-
tokio = {version = "1.12.0", features = ["rt", "macros", "rt-multi-thread"]}
47+
tokio = { version = "1.12.0", features = ["rt", "macros", "rt-multi-thread"] }
3248
cfg-if = "1"
3349
chrono = "0.4"
34-
diesel = { version = "2.1.0", default-features = false, features = ["chrono"]}
50+
diesel = { version = "2.1.0", default-features = false, features = ["chrono"] }
3551
diesel_migrations = "2.1.0"
3652

3753
[features]
3854
default = []
39-
mysql = ["diesel/mysql_backend", "mysql_async", "mysql_common", "futures-channel", "tokio"]
55+
mysql = [
56+
"diesel/mysql_backend",
57+
"mysql_async",
58+
"mysql_common",
59+
"futures-channel",
60+
"tokio",
61+
]
4062
postgres = ["diesel/postgres_backend", "tokio-postgres", "tokio", "tokio/rt"]
4163
sqlite = ["diesel/sqlite", "sync-connection-wrapper"]
4264
sync-connection-wrapper = ["tokio/rt"]
@@ -49,7 +71,17 @@ path = "tests/lib.rs"
4971
harness = true
5072

5173
[package.metadata.docs.rs]
52-
features = ["postgres", "mysql", "sqlite", "deadpool", "bb8", "mobc", "async-connection-wrapper", "sync-connection-wrapper", "r2d2"]
74+
features = [
75+
"postgres",
76+
"mysql",
77+
"sqlite",
78+
"deadpool",
79+
"bb8",
80+
"mobc",
81+
"async-connection-wrapper",
82+
"sync-connection-wrapper",
83+
"r2d2",
84+
]
5385
no-default-features = true
5486
rustc-args = ["--cfg", "doc_cfg"]
5587
rustdoc-args = ["--cfg", "doc_cfg"]

src/pooled_connection/deadpool.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub type Hook<C> = deadpool::managed::Hook<AsyncDieselConnectionManager<C>>;
6565
/// Type alias for using [`deadpool::managed::HookError`] with [`diesel-async`]
6666
pub type HookError = deadpool::managed::HookError<super::PoolError>;
6767

68-
#[async_trait::async_trait]
6968
impl<C> Manager for AsyncDieselConnectionManager<C>
7069
where
7170
C: PoolableConnection + Send + 'static,
@@ -89,8 +88,8 @@ where
8988
_: &deadpool::managed::Metrics,
9089
) -> deadpool::managed::RecycleResult<Self::Error> {
9190
if std::thread::panicking() || obj.is_broken() {
92-
return Err(deadpool::managed::RecycleError::StaticMessage(
93-
"Broken connection",
91+
return Err(deadpool::managed::RecycleError::Message(
92+
"Broken connection".into(),
9493
));
9594
}
9695
obj.ping(&self.manager_config.recycling_method)

0 commit comments

Comments
 (0)