mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-09-27 04:50:54 +00:00
Enforce consistent imports granularity through rustfmt
This commit is contained in:
parent
33524ebdad
commit
de0f31cc0b
@ -1,5 +1,6 @@
|
||||
use_small_heuristics = "Max"
|
||||
group_imports = "StdExternalCrate"
|
||||
imports_granularity = "Module"
|
||||
edition = "2018"
|
||||
unstable_features = true
|
||||
version = "Two"
|
||||
|
@ -2,8 +2,7 @@ use std::collections::HashMap;
|
||||
use std::io;
|
||||
#[cfg(unix)]
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::AtomicU16;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::atomic::{AtomicU16, Ordering};
|
||||
|
||||
use bytes::BytesMut;
|
||||
use conquer_once::Lazy;
|
||||
@ -12,7 +11,8 @@ use crossbeam::channel;
|
||||
use futures_util::future::{self, BoxFuture};
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use crate::{io::Stream as IoStream, Runtime};
|
||||
use crate::io::Stream as IoStream;
|
||||
use crate::Runtime;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Mock;
|
||||
|
@ -6,10 +6,12 @@ use actix_rt::net::TcpStream;
|
||||
#[cfg(unix)]
|
||||
use actix_rt::net::UnixStream;
|
||||
use async_compat::Compat;
|
||||
use futures_util::future::BoxFuture;
|
||||
use futures_util::io::{Read, Write};
|
||||
use futures_util::{future::BoxFuture, AsyncReadExt, AsyncWriteExt, FutureExt, TryFutureExt};
|
||||
use futures_util::{AsyncReadExt, AsyncWriteExt, FutureExt, TryFutureExt};
|
||||
|
||||
use crate::{io::Stream, Async, Runtime};
|
||||
use crate::io::Stream;
|
||||
use crate::{Async, Runtime};
|
||||
|
||||
/// Provides [`Runtime`] for [**Actix**](https://actix.rs). Supports only non-blocking operation.
|
||||
///
|
||||
|
@ -14,7 +14,8 @@ use futures_util::{AsyncReadExt, AsyncWriteExt, FutureExt};
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
use crate::blocking;
|
||||
use crate::{io::Stream, Async, Runtime};
|
||||
use crate::io::Stream;
|
||||
use crate::{Async, Runtime};
|
||||
|
||||
/// Provides [`Runtime`] for [**async-std**](https://async.rs). Supports both blocking
|
||||
/// and non-blocking operation.
|
||||
|
@ -6,10 +6,12 @@ use _tokio::net::TcpStream;
|
||||
#[cfg(unix)]
|
||||
use _tokio::net::UnixStream;
|
||||
use async_compat::Compat;
|
||||
use futures_util::future::BoxFuture;
|
||||
use futures_util::io::{Read, Write};
|
||||
use futures_util::{future::BoxFuture, AsyncReadExt, AsyncWriteExt, FutureExt, TryFutureExt};
|
||||
use futures_util::{AsyncReadExt, AsyncWriteExt, FutureExt, TryFutureExt};
|
||||
|
||||
use crate::{io::Stream, Async, Runtime};
|
||||
use crate::io::Stream;
|
||||
use crate::{Async, Runtime};
|
||||
|
||||
/// Provides [`Runtime`] for [**Tokio**](https://tokio.rs). Supports only non-blocking operation.
|
||||
///
|
||||
|
@ -12,8 +12,7 @@
|
||||
//! https://dev.mysql.com/doc/internals/en/connection-phase.html
|
||||
//!
|
||||
use sqlx_core::net::Stream as NetStream;
|
||||
use sqlx_core::Result;
|
||||
use sqlx_core::Runtime;
|
||||
use sqlx_core::{Result, Runtime};
|
||||
|
||||
use crate::protocol::{AuthResponse, Capabilities, Handshake, HandshakeResponse};
|
||||
use crate::{MySqlConnectOptions, MySqlConnection};
|
||||
@ -158,7 +157,8 @@ impl<Rt: Runtime> MySqlConnection<Rt> {
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
|
||||
use sqlx_core::{blocking::ConnectOptions, mock::Mock};
|
||||
use sqlx_core::blocking::ConnectOptions;
|
||||
use sqlx_core::mock::Mock;
|
||||
|
||||
use crate::mock::MySqlMockStreamExt;
|
||||
use crate::{MySqlConnectOptions, MySqlConnection};
|
||||
|
@ -1,4 +1,5 @@
|
||||
use bytes::{buf::Chain, Bytes};
|
||||
use bytes::buf::Chain;
|
||||
use bytes::Bytes;
|
||||
use sha1::{Digest, Sha1};
|
||||
use sqlx_core::Result;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use bytes::{buf::Chain, Buf, Bytes};
|
||||
use bytes::buf::Chain;
|
||||
use bytes::{Buf, Bytes};
|
||||
use sqlx_core::io::{BufExt, Deserialize};
|
||||
use sqlx_core::Result;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
use sqlx_core::{decode, encode, Type};
|
||||
use sqlx_core::{Decode, Encode};
|
||||
use sqlx_core::{decode, encode, Decode, Encode, Type};
|
||||
|
||||
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlTypeId, MySqlTypeInfo};
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
//!
|
||||
|
||||
use bytes::Bytes;
|
||||
use sqlx_core::{decode, encode, Type};
|
||||
use sqlx_core::{Decode, Encode};
|
||||
use sqlx_core::{decode, encode, Decode, Encode, Type};
|
||||
|
||||
use crate::io::MySqlWriteExt;
|
||||
use crate::type_info::MySqlTypeInfo;
|
||||
|
@ -1,5 +1,4 @@
|
||||
use sqlx_core::{decode, encode};
|
||||
use sqlx_core::{Decode, Encode, Type};
|
||||
use sqlx_core::{decode, encode, Decode, Encode, Type};
|
||||
|
||||
use super::uint::decode_int_or_uint;
|
||||
use crate::type_info::MySqlTypeInfo;
|
||||
|
@ -4,8 +4,7 @@ use std::error::Error as StdError;
|
||||
use std::str::FromStr;
|
||||
|
||||
use bytes::Buf;
|
||||
use sqlx_core::{decode, encode};
|
||||
use sqlx_core::{Decode, Encode, Type};
|
||||
use sqlx_core::{decode, encode, Decode, Encode, Type};
|
||||
|
||||
use crate::type_info::MySqlTypeInfo;
|
||||
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlRawValueFormat, MySqlTypeId};
|
||||
|
Loading…
x
Reference in New Issue
Block a user