style: remove unused imports

This commit is contained in:
Ryan Leckey 2021-02-12 15:22:40 -08:00
parent 4844d347e0
commit 7f036dfb4a
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9
15 changed files with 19 additions and 43 deletions

View File

@ -1,7 +1,7 @@
#[cfg(feature = "async")]
use futures_util::future::BoxFuture;
use crate::{Connection, Database, Runtime};
use crate::{Connection, Runtime};
#[allow(clippy::type_complexity)]
pub trait Acquire<Rt: Runtime> {

View File

@ -1,5 +1,4 @@
use super::Runtime;
use crate::Database;
pub trait Acquire<Rt>: crate::Acquire<Rt>
where
@ -25,7 +24,3 @@ where
where
Self::Connection: Sized;
}
// TODO: impl Acquire for &Pool { ... }
// TODO: impl<C: Connection> Acquire for &mut C { ... }
// TODO: impl<A: Acquire> Acquire for &mut &A { ... }

View File

@ -3,7 +3,7 @@ use std::fmt::{self, Display, Formatter};
use std::str::Utf8Error;
use crate::database::HasRawValue;
use crate::{Database, Runtime};
use crate::Database;
/// A type that can be decoded from a SQL value.
pub trait Decode<'r, Db: Database>: Sized + Send + Sync {

View File

@ -1,8 +1,8 @@
use std::error::Error as StdError;
use std::fmt::{self, Display, Formatter};
use crate::database::{HasOutput, HasRawValue};
use crate::{Database, Runtime};
use crate::database::HasOutput;
use crate::Database;
/// A type that can be encoded into a SQL value.
pub trait Encode<Db: Database>: Send + Sync {

View File

@ -1,7 +1,7 @@
#[cfg(feature = "async")]
use futures_util::future::{self, BoxFuture, FutureExt, TryFutureExt};
use crate::{Database, Error, Result, Runtime};
use crate::{Database, Runtime};
/// Describes a type that can execute SQL queries on a self-provided database connection.
///
@ -21,7 +21,7 @@ pub trait Executor<Rt: Runtime> {
fn execute<'x, 'e, 'q>(
&'e mut self,
sql: &'q str,
) -> BoxFuture<'x, Result<<Self::Database as Database>::QueryResult>>
) -> BoxFuture<'x, crate::Result<<Self::Database as Database>::QueryResult>>
where
Rt: crate::Async,
'e: 'x,
@ -31,7 +31,7 @@ pub trait Executor<Rt: Runtime> {
fn fetch_all<'x, 'e, 'q>(
&'e mut self,
sql: &'q str,
) -> BoxFuture<'x, Result<Vec<<Self::Database as Database>::Row>>>
) -> BoxFuture<'x, crate::Result<Vec<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
'e: 'x,
@ -41,7 +41,7 @@ pub trait Executor<Rt: Runtime> {
fn fetch_optional<'x, 'e, 'q>(
&'e mut self,
sql: &'q str,
) -> BoxFuture<'x, Result<Option<<Self::Database as Database>::Row>>>
) -> BoxFuture<'x, crate::Result<Option<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
'e: 'x,
@ -51,7 +51,7 @@ pub trait Executor<Rt: Runtime> {
fn fetch_one<'x, 'e, 'q>(
&'e mut self,
sql: &'q str,
) -> BoxFuture<'x, Result<<Self::Database as Database>::Row>>
) -> BoxFuture<'x, crate::Result<<Self::Database as Database>::Row>>
where
Rt: crate::Async,
'e: 'x,
@ -60,7 +60,7 @@ pub trait Executor<Rt: Runtime> {
self.fetch_optional(sql)
.and_then(|maybe_row| match maybe_row {
Some(row) => future::ok(row),
None => future::err(Error::RowNotFound),
None => future::err(crate::Error::RowNotFound),
})
.boxed()
}

View File

@ -1,8 +1,6 @@
use std::fmt::Debug;
use std::str::FromStr;
use crate::Connect;
/// Options which can be used to configure how a SQL connection is opened.
#[allow(clippy::module_name_repetitions)]
pub trait ConnectOptions:
@ -12,7 +10,7 @@ pub trait ConnectOptions:
#[cfg(feature = "async")]
fn connect<C, Rt>(&self) -> futures_util::future::BoxFuture<'_, crate::Result<C>>
where
C: Connect<Rt, Options = Self> + Sized,
C: crate::Connect<Rt, Options = Self> + Sized,
Rt: crate::Async,
{
C::connect_with(self)

View File

@ -1,5 +1,5 @@
use crate::database::HasRawValue;
use crate::{Column, Database, Decode, Runtime};
use crate::{Database, Decode};
pub trait Row: 'static + Send + Sync {
type Database: Database;

View File

@ -1,11 +1,8 @@
use std::fmt::{self, Debug, Formatter};
use std::marker::PhantomData;
use std::path::PathBuf;
use either::Either;
use sqlx_core::{ConnectOptions, Result, Runtime};
use crate::MySqlConnection;
use sqlx_core::ConnectOptions;
mod builder;
mod default;

View File

@ -2,7 +2,6 @@ use std::mem;
use std::path::{Path, PathBuf};
use either::Either;
use sqlx_core::Runtime;
impl super::MySqlConnectOptions {
/// Sets the hostname of the database server.

View File

@ -1,7 +1,5 @@
use std::path::{Path, PathBuf};
use sqlx_core::Runtime;
use super::{default, MySqlConnectOptions};
impl MySqlConnectOptions {

View File

@ -1,7 +1,3 @@
use bytes::BufMut;
use crate::MySqlTypeId;
// https://dev.mysql.com/doc/internals/en/com-stmt-execute.html
// 'x: single execution

View File

@ -1,7 +1,5 @@
use std::marker::PhantomData;
use bytes::Bytes;
use sqlx_core::{Decode, Error, Row, Runtime};
use sqlx_core::{Decode, Error, Row};
use crate::{protocol, MySql, MySqlColumn, MySqlRawValue, MySqlRawValueFormat};

View File

@ -1,8 +1,7 @@
use bytes::BufMut;
use sqlx_core::{decode, encode};
use sqlx_core::{Decode, Encode};
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlTypeId, MySqlTypeInfo};
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlTypeInfo};
// In MySQL, a boolean is an alias for `TINYINT(1) UNSIGNED`
// the functions below delegate functionality to the `u8` impls

View File

@ -1,11 +1,8 @@
use bytes::Buf;
use sqlx_core::database::HasOutput;
use sqlx_core::{decode, encode};
use sqlx_core::{Database, Decode, Encode};
use sqlx_core::{Decode, Encode};
use crate::type_info::MySqlTypeInfo;
use crate::MySqlRawValueFormat::*;
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlTypeId};
use crate::{MySql, MySqlOutput, MySqlRawValue};
// https://dev.mysql.com/doc/internals/en/binary-protocol-value.html#packet-ProtocolBinary

View File

@ -1,11 +1,10 @@
use bytes::Buf;
use sqlx_core::database::HasOutput;
use sqlx_core::{decode, encode};
use sqlx_core::{Database, Decode, Encode};
use sqlx_core::{Decode, Encode};
use crate::type_info::MySqlTypeInfo;
use crate::MySqlRawValueFormat::*;
use crate::{MySql, MySqlOutput, MySqlRawValue, MySqlTypeId};
use crate::{MySql, MySqlOutput, MySqlRawValue};
// https://dev.mysql.com/doc/internals/en/binary-protocol-value.html#packet-ProtocolBinary