Skip to content

Commit 9b50dcc

Browse files
committed
Run rustfmt
1 parent c4a0ac5 commit 9b50dcc

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

sqlx-core/src/pool/inner.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
33
use std::sync::Arc;
44
use std::time::Instant;
55

6+
use async_std::{future::timeout, task};
67
use crossbeam_queue::{ArrayQueue, SegQueue};
78
use futures_channel::oneshot::{channel, Sender};
8-
use async_std::{task, future::timeout};
99

10-
use super::{Idle, Options, Live};
10+
use super::{Idle, Live, Options};
1111
use crate::{error::Error, Connection, Database};
1212

1313
pub(super) struct SharedPool<DB>
@@ -27,10 +27,7 @@ where
2727
DB: Database,
2828
DB::Connection: Connection<Database = DB>,
2929
{
30-
pub(super) async fn new_arc(
31-
url: &str,
32-
options: Options,
33-
) -> crate::Result<Arc<Self>> {
30+
pub(super) async fn new_arc(url: &str, options: Options) -> crate::Result<Arc<Self>> {
3431
let pool = Arc::new(Self {
3532
url: url.to_owned(),
3633
idle: ArrayQueue::new(options.max_size as usize),
@@ -48,7 +45,7 @@ where
4845
.eventually_connect(Instant::now() + pool.options.connect_timeout)
4946
.await?;
5047

51-
// Ignore error here, we are capping this loop by min_size which we
48+
// Ignore error here, we are capping this loop by min_size which we
5249
// already should make sure is less than max_size
5350
let _ = pool.idle.push(Idle {
5451
live,
@@ -114,9 +111,7 @@ where
114111
// successfully released
115112
Ok(()) => return,
116113

117-
Err(live) => {
118-
live
119-
},
114+
Err(live) => live,
120115
};
121116
}
122117

@@ -143,7 +138,7 @@ where
143138
}
144139

145140
let size = self.size.load(Ordering::Acquire);
146-
141+
147142
if size >= self.options.max_size {
148143
// Too many open connections
149144
// Wait until one is available

sqlx-core/src/pool/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ where
9494
self
9595
}
9696

97-
/// If true, the health of a connection will be verified by a call to `Connection::ping`
97+
/// If true, the health of a connection will be verified by a call to `Connection::ping`
9898
/// before returning the connection.
99-
///
99+
///
100100
/// Defaults to `true`.
101101
pub fn test_on_acquire(mut self, test: bool) -> Self {
102102
self.options.test_on_acquire = test;

0 commit comments

Comments
 (0)