Skip to content

Commit f71e9fa

Browse files
committed
fix: fmt
1 parent c9730f6 commit f71e9fa

File tree

4 files changed

+56
-35
lines changed

4 files changed

+56
-35
lines changed

src/async_connection_wrapper.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
//! as replacement for the existing connection
1010
//! implementations provided by diesel
1111
12-
use futures_util::Future;
13-
use futures_util::Stream;
14-
use futures_util::StreamExt;
12+
use futures_util::{Future, Stream, StreamExt};
1513
use std::pin::Pin;
1614

1715
/// This is a helper trait that allows to customize the
@@ -194,13 +192,15 @@ mod implementation {
194192
C: crate::AsyncConnection,
195193
B: BlockOn + Send,
196194
{
197-
type Cursor<'conn, 'query> = AsyncCursorWrapper<'conn, C::Stream<'conn, 'query>, B>
198-
where
199-
Self: 'conn;
195+
type Cursor<'conn, 'query>
196+
= AsyncCursorWrapper<'conn, C::Stream<'conn, 'query>, B>
197+
where
198+
Self: 'conn;
200199

201-
type Row<'conn, 'query> = C::Row<'conn, 'query>
202-
where
203-
Self: 'conn;
200+
type Row<'conn, 'query>
201+
= C::Row<'conn, 'query>
202+
where
203+
Self: 'conn;
204204

205205
fn load<'conn, 'query, T>(
206206
&'conn mut self,

src/mysql/row.rs

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
use diesel::backend::Backend;
2-
use diesel::mysql::data_types::{MysqlTime, MysqlTimestampType};
3-
use diesel::mysql::{Mysql, MysqlType, MysqlValue};
4-
use diesel::row::{PartialRow, RowIndex, RowSealed};
5-
use mysql_async::consts::{ColumnFlags, ColumnType};
6-
use mysql_async::{Column, Row, Value};
1+
use diesel::{
2+
backend::Backend,
3+
mysql::{
4+
data_types::{MysqlTime, MysqlTimestampType},
5+
Mysql, MysqlType, MysqlValue,
6+
},
7+
row::{PartialRow, RowIndex, RowSealed},
8+
};
9+
use mysql_async::{
10+
consts::{ColumnFlags, ColumnType},
11+
Column, Row, Value,
12+
};
713
use std::borrow::Cow;
814

915
pub struct MysqlRow(pub(super) Row);
@@ -37,7 +43,11 @@ impl RowSealed for MysqlRow {}
3743

3844
impl<'a> diesel::row::Row<'a, Mysql> for MysqlRow {
3945
type InnerPartialRow = Self;
40-
type Field<'b> = MysqlField<'b> where Self: 'b, 'a: 'b;
46+
type Field<'b>
47+
= MysqlField<'b>
48+
where
49+
Self: 'b,
50+
'a: 'b;
4151

4252
fn field_count(&self) -> usize {
4353
self.0.columns_ref().len()

src/pg/row.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use diesel::backend::Backend;
2-
use diesel::row::{Field, PartialRow, RowIndex, RowSealed};
1+
use diesel::{
2+
backend::Backend,
3+
row::{Field, PartialRow, RowIndex, RowSealed},
4+
};
35
use std::{error::Error, num::NonZeroU32};
46
use tokio_postgres::{types::Type, Row};
57

@@ -16,7 +18,11 @@ impl RowSealed for PgRow {}
1618

1719
impl<'a> diesel::row::Row<'a, diesel::pg::Pg> for PgRow {
1820
type InnerPartialRow = Self;
19-
type Field<'b> = PgField<'b> where Self: 'b, 'a: 'b;
21+
type Field<'b>
22+
= PgField<'b>
23+
where
24+
Self: 'b,
25+
'a: 'b;
2026

2127
fn field_count(&self) -> usize {
2228
self.row.len()

src/run_query_dsl/mod.rs

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::AsyncConnection;
2-
use diesel::associations::HasTable;
3-
use diesel::query_builder::IntoUpdateTarget;
4-
use diesel::result::QueryResult;
5-
use diesel::AsChangeset;
2+
use diesel::{
3+
associations::HasTable, query_builder::IntoUpdateTarget, result::QueryResult, AsChangeset,
4+
};
65
use futures_util::{future, stream, FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
76
use std::pin::Pin;
87

@@ -14,11 +13,13 @@ use std::pin::Pin;
1413
/// these traits.
1514
pub mod methods {
1615
use super::*;
17-
use diesel::backend::Backend;
18-
use diesel::deserialize::FromSqlRow;
19-
use diesel::expression::QueryMetadata;
20-
use diesel::query_builder::{AsQuery, QueryFragment, QueryId};
21-
use diesel::query_dsl::CompatibleType;
16+
use diesel::{
17+
backend::Backend,
18+
deserialize::FromSqlRow,
19+
expression::QueryMetadata,
20+
query_builder::{AsQuery, QueryFragment, QueryId},
21+
query_dsl::CompatibleType,
22+
};
2223
use futures_util::{Future, Stream, TryFutureExt};
2324

2425
/// The `execute` method
@@ -92,17 +93,21 @@ pub mod methods {
9293
DB: QueryMetadata<T::SqlType>,
9394
ST: 'static,
9495
{
95-
type LoadFuture<'conn> = future::MapOk<
96+
type LoadFuture<'conn>
97+
= future::MapOk<
9698
Conn::LoadFuture<'conn, 'query>,
9799
fn(Conn::Stream<'conn, 'query>) -> Self::Stream<'conn>,
98-
> where Conn: 'conn;
100+
>
101+
where
102+
Conn: 'conn;
99103

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

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

0 commit comments

Comments
 (0)