File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ impl AsyncConnection for AsyncPgConnection {
123
123
. map_err ( ErrorHelper ) ?;
124
124
tokio:: spawn ( async move {
125
125
if let Err ( e) = connection. await {
126
- eprintln ! ( "connection error: {}" , e ) ;
126
+ eprintln ! ( "connection error: {e}" ) ;
127
127
}
128
128
} ) ;
129
129
Self :: try_from ( client) . await
Original file line number Diff line number Diff line change @@ -39,14 +39,17 @@ impl fmt::Display for PoolError {
39
39
40
40
impl std:: error:: Error for PoolError { }
41
41
42
+ type SetupCallback < C > =
43
+ Box < dyn Fn ( & str ) -> future:: BoxFuture < diesel:: ConnectionResult < C > > + Send + Sync > ;
44
+
42
45
/// An connection manager for use with diesel-async.
43
46
///
44
47
/// See the concrete pool implementations for examples:
45
48
/// * [deadpool](self::deadpool)
46
49
/// * [bb8](self::bb8)
47
50
/// * [mobc](self::mobc)
48
51
pub struct AsyncDieselConnectionManager < C > {
49
- setup : Box < dyn Fn ( & str ) -> future :: BoxFuture < diesel :: ConnectionResult < C > > + Send + Sync > ,
52
+ setup : SetupCallback < C > ,
50
53
connection_url : String ,
51
54
}
52
55
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ where
292
292
let start_transaction_sql = match transaction_state. transaction_depth ( ) {
293
293
None => Cow :: from ( "BEGIN" ) ,
294
294
Some ( transaction_depth) => {
295
- Cow :: from ( format ! ( "SAVEPOINT diesel_savepoint_{}" , transaction_depth ) )
295
+ Cow :: from ( format ! ( "SAVEPOINT diesel_savepoint_{transaction_depth}" ) )
296
296
}
297
297
} ;
298
298
conn. batch_execute ( & start_transaction_sql) . await ?;
You can’t perform that action at this time.
0 commit comments