Skip to content

Commit ab60ce1

Browse files
committed
Address some new clippy warnings
1 parent f9b040b commit ab60ce1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/pg/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl AsyncConnection for AsyncPgConnection {
123123
.map_err(ErrorHelper)?;
124124
tokio::spawn(async move {
125125
if let Err(e) = connection.await {
126-
eprintln!("connection error: {}", e);
126+
eprintln!("connection error: {e}");
127127
}
128128
});
129129
Self::try_from(client).await

src/pooled_connection/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ impl fmt::Display for PoolError {
3939

4040
impl std::error::Error for PoolError {}
4141

42+
type SetupCallback<C> =
43+
Box<dyn Fn(&str) -> future::BoxFuture<diesel::ConnectionResult<C>> + Send + Sync>;
44+
4245
/// An connection manager for use with diesel-async.
4346
///
4447
/// See the concrete pool implementations for examples:
4548
/// * [deadpool](self::deadpool)
4649
/// * [bb8](self::bb8)
4750
/// * [mobc](self::mobc)
4851
pub struct AsyncDieselConnectionManager<C> {
49-
setup: Box<dyn Fn(&str) -> future::BoxFuture<diesel::ConnectionResult<C>> + Send + Sync>,
52+
setup: SetupCallback<C>,
5053
connection_url: String,
5154
}
5255

src/transaction_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ where
292292
let start_transaction_sql = match transaction_state.transaction_depth() {
293293
None => Cow::from("BEGIN"),
294294
Some(transaction_depth) => {
295-
Cow::from(format!("SAVEPOINT diesel_savepoint_{}", transaction_depth))
295+
Cow::from(format!("SAVEPOINT diesel_savepoint_{transaction_depth}"))
296296
}
297297
};
298298
conn.batch_execute(&start_transaction_sql).await?;

0 commit comments

Comments
 (0)