mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
Run rustfmt
This commit is contained in:
parent
ae4fcd1406
commit
809bc3964c
@ -1,7 +1,7 @@
|
||||
use std::io;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use crate::runtime::{AsyncRead, AsyncReadExt, AsyncWriteExt, AsyncWrite};
|
||||
use crate::runtime::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||
|
||||
const RBUF_SIZE: usize = 8 * 1024;
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
use std::io::{IoSlice, IoSliceMut};
|
||||
use std::pin::Pin;
|
||||
use std::net::Shutdown;
|
||||
use std::io;
|
||||
use std::io::{IoSlice, IoSliceMut};
|
||||
use std::net::Shutdown;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use crate::runtime::{TcpStream, AsyncRead, AsyncWrite};
|
||||
use crate::runtime::{AsyncRead, AsyncWrite, TcpStream};
|
||||
use crate::url::Url;
|
||||
|
||||
use self::Inner::*;
|
||||
@ -57,7 +57,7 @@ impl MaybeTlsStream {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn shutdown(&self, how:Shutdown) -> io::Result<()> {
|
||||
pub fn shutdown(&self, how: Shutdown) -> io::Result<()> {
|
||||
match self.inner {
|
||||
NotTls(ref conn) => conn.shutdown(how),
|
||||
#[cfg(feature = "tls")]
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
use std::convert::TryInto;
|
||||
use std::io;
|
||||
|
||||
use std::net::Shutdown;
|
||||
use byteorder::{ByteOrder, LittleEndian};
|
||||
use futures_core::future::BoxFuture;
|
||||
use sha1::Sha1;
|
||||
use std::net::Shutdown;
|
||||
|
||||
use crate::cache::StatementCache;
|
||||
use crate::connection::{Connect, Connection};
|
||||
@ -451,8 +451,8 @@ impl MySqlConnection {
|
||||
ca_file: Option<&str>,
|
||||
invalid_hostnames: bool,
|
||||
) -> crate::Result<()> {
|
||||
use async_native_tls::{Certificate, TlsConnector};
|
||||
use crate::runtime::fs;
|
||||
use async_native_tls::{Certificate, TlsConnector};
|
||||
|
||||
let mut connector = TlsConnector::new()
|
||||
.danger_accept_invalid_certs(ca_file.is_none())
|
||||
|
||||
@ -6,8 +6,8 @@ use std::time::Instant;
|
||||
use crossbeam_queue::{ArrayQueue, SegQueue};
|
||||
use futures_channel::oneshot::{channel, Sender};
|
||||
|
||||
use crate::runtime::{sleep, spawn, timeout, yield_now};
|
||||
use super::{Idle, Live, Options};
|
||||
use crate::runtime::{sleep, spawn, timeout, yield_now};
|
||||
use crate::{
|
||||
connection::{Connect, Connection},
|
||||
error::Error,
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
use std::convert::TryInto;
|
||||
|
||||
use std::net::Shutdown;
|
||||
use byteorder::NetworkEndian;
|
||||
use futures_core::future::BoxFuture;
|
||||
use hmac::{Hmac, Mac};
|
||||
use rand::Rng;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::net::Shutdown;
|
||||
|
||||
use crate::cache::StatementCache;
|
||||
use crate::connection::{Connect, Connection};
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
#[cfg(feature = "runtime-async-std")]
|
||||
pub use async_std::{
|
||||
net::TcpStream,
|
||||
future::timeout,
|
||||
fs,
|
||||
future::timeout,
|
||||
io::prelude::{ReadExt as AsyncReadExt, WriteExt as AsyncWriteExt},
|
||||
io::{Read as AsyncRead, Write as AsyncWrite},
|
||||
net::TcpStream,
|
||||
task::sleep,
|
||||
task::spawn,
|
||||
task::yield_now,
|
||||
task::sleep,
|
||||
io::{Read as AsyncRead, Write as AsyncWrite},
|
||||
io::prelude::{ReadExt as AsyncReadExt, WriteExt as AsyncWriteExt}
|
||||
};
|
||||
|
||||
#[cfg(feature = "runtime-tokio")]
|
||||
pub use tokio::{
|
||||
io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},
|
||||
fs,
|
||||
time::timeout,
|
||||
io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},
|
||||
net::TcpStream,
|
||||
task::spawn,
|
||||
task::yield_now,
|
||||
time::delay_for as sleep,
|
||||
time::timeout,
|
||||
};
|
||||
|
||||
@ -3,11 +3,11 @@ use std::ops::{Deref, DerefMut};
|
||||
use futures_core::future::BoxFuture;
|
||||
use futures_core::stream::BoxStream;
|
||||
|
||||
use crate::runtime::spawn;
|
||||
use crate::connection::Connection;
|
||||
use crate::database::Database;
|
||||
use crate::describe::Describe;
|
||||
use crate::executor::Executor;
|
||||
use crate::runtime::spawn;
|
||||
|
||||
pub struct Transaction<T>
|
||||
where
|
||||
@ -27,9 +27,7 @@ where
|
||||
} else {
|
||||
let stmt = format!("SAVEPOINT _sqlx_savepoint_{}", depth);
|
||||
|
||||
inner
|
||||
.send(&stmt)
|
||||
.await?;
|
||||
inner.send(&stmt).await?;
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
@ -51,9 +49,7 @@ where
|
||||
} else {
|
||||
let stmt = format!("RELEASE SAVEPOINT _sqlx_savepoint_{}", depth - 1);
|
||||
|
||||
inner
|
||||
.send(&stmt)
|
||||
.await?;
|
||||
inner.send(&stmt).await?;
|
||||
}
|
||||
|
||||
Ok(inner)
|
||||
@ -66,14 +62,9 @@ where
|
||||
if depth == 1 {
|
||||
inner.send("ROLLBACK").await?;
|
||||
} else {
|
||||
let stmt = format!(
|
||||
"ROLLBACK TO SAVEPOINT _sqlx_savepoint_{}",
|
||||
depth - 1
|
||||
);
|
||||
let stmt = format!("ROLLBACK TO SAVEPOINT _sqlx_savepoint_{}", depth - 1);
|
||||
|
||||
inner
|
||||
.send(&stmt)
|
||||
.await?;
|
||||
inner.send(&stmt).await?;
|
||||
}
|
||||
|
||||
Ok(inner)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use std::env;
|
||||
|
||||
use sqlx::runtime::fs;
|
||||
use proc_macro2::{Ident, Span, TokenStream};
|
||||
use sqlx::runtime::fs;
|
||||
use syn::parse::{Parse, ParseStream};
|
||||
use syn::punctuated::Punctuated;
|
||||
use syn::spanned::Spanned;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use sqlx::{PgConnection, Connect};
|
||||
use sqlx::{Connect, PgConnection};
|
||||
|
||||
#[cfg_attr(feature = "runtime-async-std", async_std::test)]
|
||||
#[cfg_attr(feature = "runtime-tokio", tokio::test)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user