Skip to content

Commit c7569a5

Browse files
authored
Merge pull request #204 from sabify/upgrade-bb8
2 parents e3beac6 + 9fe605c commit c7569a5

File tree

6 files changed

+55
-42
lines changed

6 files changed

+55
-42
lines changed

Cargo.toml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ rust-version = "1.78.0"
1414

1515
[dependencies]
1616
diesel = { version = "~2.2.0", default-features = false, features = [
17-
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
17+
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
1818
] }
1919
async-trait = "0.1.66"
2020
futures-channel = { version = "0.3.17", default-features = false, features = [
21-
"std",
22-
"sink",
21+
"std",
22+
"sink",
2323
], optional = true }
2424
futures-util = { version = "0.3.17", default-features = false, features = [
25-
"std",
26-
"sink",
25+
"std",
26+
"sink",
2727
] }
2828
tokio-postgres = { version = "0.7.10", optional = true }
2929
tokio = { version = "1.26", optional = true }
3030
mysql_async = { version = "0.34", optional = true, default-features = false, features = [
31-
"minimal-rust",
31+
"minimal-rust",
3232
] }
3333
mysql_common = { version = "0.32", optional = true, default-features = false }
3434

35-
bb8 = { version = "0.8", optional = true }
35+
bb8 = { version = "0.9", optional = true }
3636
deadpool = { version = "0.12", optional = true, default-features = false, features = [
37-
"managed",
37+
"managed",
3838
] }
3939
mobc = { version = ">=0.7,<0.10", optional = true }
4040
scoped-futures = { version = "0.1", features = ["std"] }
@@ -50,11 +50,11 @@ assert_matches = "1.0.1"
5050
[features]
5151
default = []
5252
mysql = [
53-
"diesel/mysql_backend",
54-
"mysql_async",
55-
"mysql_common",
56-
"futures-channel",
57-
"tokio",
53+
"diesel/mysql_backend",
54+
"mysql_async",
55+
"mysql_common",
56+
"futures-channel",
57+
"tokio",
5858
]
5959
postgres = ["diesel/postgres_backend", "tokio-postgres", "tokio", "tokio/rt"]
6060
sqlite = ["diesel/sqlite", "sync-connection-wrapper"]
@@ -73,24 +73,24 @@ harness = true
7373

7474
[package.metadata.docs.rs]
7575
features = [
76-
"postgres",
77-
"mysql",
78-
"sqlite",
79-
"deadpool",
80-
"bb8",
81-
"mobc",
82-
"async-connection-wrapper",
83-
"sync-connection-wrapper",
84-
"r2d2",
76+
"postgres",
77+
"mysql",
78+
"sqlite",
79+
"deadpool",
80+
"bb8",
81+
"mobc",
82+
"async-connection-wrapper",
83+
"sync-connection-wrapper",
84+
"r2d2",
8585
]
8686
no-default-features = true
8787
rustc-args = ["--cfg", "docsrs"]
8888
rustdoc-args = ["--cfg", "docsrs"]
8989

9090
[workspace]
9191
members = [
92-
".",
93-
"examples/postgres/pooled-with-rustls",
94-
"examples/postgres/run-pending-migrations-with-rustls",
95-
"examples/sync-wrapper",
92+
".",
93+
"examples/postgres/pooled-with-rustls",
94+
"examples/postgres/run-pending-migrations-with-rustls",
95+
"examples/sync-wrapper",
9696
]

src/async_connection_wrapper.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,15 @@ mod implementation {
194194
C: crate::AsyncConnection,
195195
B: BlockOn + Send,
196196
{
197-
type Cursor<'conn, 'query> = AsyncCursorWrapper<'conn, C::Stream<'conn, 'query>, B>
198-
where
199-
Self: 'conn;
197+
type Cursor<'conn, 'query>
198+
= AsyncCursorWrapper<'conn, C::Stream<'conn, 'query>, B>
199+
where
200+
Self: 'conn;
200201

201-
type Row<'conn, 'query> = C::Row<'conn, 'query>
202-
where
203-
Self: 'conn;
202+
type Row<'conn, 'query>
203+
= C::Row<'conn, 'query>
204+
where
205+
Self: 'conn;
204206

205207
fn load<'conn, 'query, T>(
206208
&'conn mut self,

src/mysql/row.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ impl RowSealed for MysqlRow {}
3737

3838
impl<'a> diesel::row::Row<'a, Mysql> for MysqlRow {
3939
type InnerPartialRow = Self;
40-
type Field<'b> = MysqlField<'b> where Self: 'b, 'a: 'b;
40+
type Field<'b>
41+
= MysqlField<'b>
42+
where
43+
Self: 'b,
44+
'a: 'b;
4145

4246
fn field_count(&self) -> usize {
4347
self.0.columns_ref().len()

src/pg/row.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ impl RowSealed for PgRow {}
1616

1717
impl<'a> diesel::row::Row<'a, diesel::pg::Pg> for PgRow {
1818
type InnerPartialRow = Self;
19-
type Field<'b> = PgField<'b> where Self: 'b, 'a: 'b;
19+
type Field<'b>
20+
= PgField<'b>
21+
where
22+
Self: 'b,
23+
'a: 'b;
2024

2125
fn field_count(&self) -> usize {
2226
self.row.len()

src/pooled_connection/bb8.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub type PooledConnection<'a, C> = bb8::PooledConnection<'a, AsyncDieselConnecti
6565
/// Type alias for using [`bb8::RunError`] with [`diesel-async`]
6666
pub type RunError = bb8::RunError<super::PoolError>;
6767

68-
#[async_trait::async_trait]
6968
impl<C> ManageConnection for AsyncDieselConnectionManager<C>
7069
where
7170
C: PoolableConnection + 'static,

src/run_query_dsl/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,21 @@ pub mod methods {
9292
DB: QueryMetadata<T::SqlType>,
9393
ST: 'static,
9494
{
95-
type LoadFuture<'conn> = future::MapOk<
95+
type LoadFuture<'conn>
96+
= future::MapOk<
9697
Conn::LoadFuture<'conn, 'query>,
9798
fn(Conn::Stream<'conn, 'query>) -> Self::Stream<'conn>,
98-
> where Conn: 'conn;
99+
>
100+
where
101+
Conn: 'conn;
99102

100-
type Stream<'conn> = stream::Map<
103+
type Stream<'conn>
104+
= stream::Map<
101105
Conn::Stream<'conn, 'query>,
102-
fn(
103-
QueryResult<Conn::Row<'conn, 'query>>,
104-
) -> QueryResult<U>,
105-
>where Conn: 'conn;
106+
fn(QueryResult<Conn::Row<'conn, 'query>>) -> QueryResult<U>,
107+
>
108+
where
109+
Conn: 'conn;
106110

107111
fn internal_load(self, conn: &mut Conn) -> Self::LoadFuture<'_> {
108112
conn.load(self)

0 commit comments

Comments
 (0)