Skip to content

Commit 64efad6

Browse files
committed
fust fmt
1 parent 203a2b8 commit 64efad6

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

sqlx-core/src/any/connection/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ impl AnyConnection {
6161
#[cfg(feature = "migrate")]
6262
pub(crate) fn get_migrate(
6363
&mut self,
64-
) -> crate::Result<&mut (dyn crate::migrate::Migrate + Send + 'static)>
65-
{
64+
) -> crate::Result<&mut (dyn crate::migrate::Migrate + Send + 'static)> {
6665
self.backend.as_migrate()
6766
}
6867
}

sqlx-core/src/any/driver.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ impl AnyDriver {
6767
{
6868
Self {
6969
migrate_database: Some(AnyMigrateDatabase {
70-
create_database: DebugFn(|url| Box::pin(async move { DB::create_database(url).await })),
71-
database_exists: DebugFn(|url| Box::pin(async move { DB::database_exists(url).await })),
70+
create_database: DebugFn(|url| {
71+
Box::pin(async move { DB::create_database(url).await })
72+
}),
73+
database_exists: DebugFn(|url| {
74+
Box::pin(async move { DB::database_exists(url).await })
75+
}),
7276
drop_database: DebugFn(|url| Box::pin(async move { DB::drop_database(url).await })),
73-
force_drop_database: DebugFn(|url| Box::pin(async move { DB::force_drop_database(url).await })),
77+
force_drop_database: DebugFn(|url| {
78+
Box::pin(async move { DB::force_drop_database(url).await })
79+
}),
7480
}),
7581
..Self::without_migrate::<DB>()
7682
}

sqlx-core/src/connection.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::database::{Database, HasStatementCache};
2-
use std::future::Future;
32
use crate::error::Error;
3+
use std::future::Future;
44

55
use crate::transaction::Transaction;
66
use futures_core::future::BoxFuture;
@@ -46,7 +46,9 @@ pub trait Connection: Send {
4646
/// Begin a new transaction or establish a savepoint within the active transaction.
4747
///
4848
/// Returns a [`Transaction`] for controlling and tracking the new transaction.
49-
fn begin(&mut self) -> impl Future<Output = Result<Transaction<'_, Self::Database>, Error>> + Send + '_
49+
fn begin(
50+
&mut self,
51+
) -> impl Future<Output = Result<Transaction<'_, Self::Database>, Error>> + Send + '_
5052
where
5153
Self: Sized;
5254

@@ -67,7 +69,10 @@ pub trait Connection: Send {
6769
/// })).await
6870
/// # }
6971
/// ```
70-
fn transaction<'a, F, R, E>(&'a mut self, callback: F) -> impl Future<Output = Result<R, E>> + Send + 'a
72+
fn transaction<'a, F, R, E>(
73+
&'a mut self,
74+
callback: F,
75+
) -> impl Future<Output = Result<R, E>> + Send + 'a
7176
where
7277
for<'c> F: FnOnce(&'c mut Transaction<'_, Self::Database>) -> BoxFuture<'c, Result<R, E>>
7378
+ 'a
@@ -137,7 +142,7 @@ pub trait Connection: Send {
137142
///
138143
/// A value of [`Options`][Self::Options] is parsed from the provided connection string. This parsing
139144
/// is database-specific.
140-
#[inline]
145+
#[inline]
141146
fn connect(url: &str) -> impl Future<Output = Result<Self, Error>> + Send + 'static
142147
where
143148
Self: Sized,
@@ -147,11 +152,12 @@ pub trait Connection: Send {
147152
async move { Self::connect_with(&options?).await }
148153
}
149154

150-
151155
/// Establish a new database connection with the provided options.
152-
fn connect_with(options: &Self::Options) -> impl Future<Output = Result<Self, Error>> + Send + '_
156+
fn connect_with(
157+
options: &Self::Options,
158+
) -> impl Future<Output = Result<Self, Error>> + Send + '_
153159
where
154-
Self: Sized
160+
Self: Sized,
155161
{
156162
options.connect()
157163
}

sqlx-core/src/migrate/migrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::error::Error;
22
use crate::migrate::{AppliedMigration, MigrateError, Migration};
33
use futures_core::future::BoxFuture;
4-
use std::time::Duration;
54
use std::future::Future;
5+
use std::time::Duration;
66

77
pub trait MigrateDatabase {
88
// create database in url

sqlx-core/src/testing/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ pub trait TestSupport: Database {
2424
///
2525
/// The implementation may require `DATABASE_URL` to be set in order to manage databases.
2626
/// The user credentials it contains must have the privilege to create and drop databases.
27-
fn test_context(args: &TestArgs) -> impl Future<Output = Result<TestContext<Self>, Error>> + Send + '_;
27+
fn test_context(
28+
args: &TestArgs,
29+
) -> impl Future<Output = Result<TestContext<Self>, Error>> + Send + '_;
2830

2931
fn cleanup_test(db_name: &str) -> impl Future<Output = Result<(), Error>> + Send + '_;
3032

sqlx-core/src/transaction.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::borrow::Cow;
2-
use std::future::Future;
32
use std::fmt::{self, Debug, Formatter};
3+
use std::future::Future;
44
use std::ops::{Deref, DerefMut};
55

66
use futures_core::future::BoxFuture;
@@ -31,7 +31,6 @@ pub trait TransactionManager {
3131
conn: &mut <Self::Database as Database>::Connection,
3232
) -> impl Future<Output = Result<(), Error>> + Send;
3333

34-
3534
/// Starts to abort the active transaction or restore from the most recent snapshot.
3635
fn start_rollback(conn: &mut <Self::Database as Database>::Connection);
3736
}
@@ -233,7 +232,7 @@ impl<'c, 't, DB: Database> crate::acquire::Acquire<'t> for &'t mut Transaction<'
233232
type Connection = &'t mut <DB as Database>::Connection;
234233

235234
#[inline]
236-
fn acquire(self) -> BoxFuture<'t, Result<Self::Connection, Error>> {
235+
fn acquire(self) -> BoxFuture<'t, Result<Self::Connection, Error>> {
237236
Box::pin(futures_util::future::ok(&mut **self))
238237
}
239238

0 commit comments

Comments
 (0)