style: remove unused imports

This commit is contained in:
Ryan Leckey 2021-02-26 00:23:40 -08:00
parent f6655c827a
commit 85c11b3f2f
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9
7 changed files with 10 additions and 15 deletions

View File

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

View File

@ -2,7 +2,7 @@ use std::error::Error as StdError;
use std::fmt::{self, Display, Formatter};
use crate::database::HasOutput;
use crate::{Database, Type, TypeInfo};
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,4 @@
use std::any;
use crate::database::HasRawValue;
use crate::{decode, Database, Decode, TypeDecode, TypeInfo};
use crate::Database;
// NOTE: Add decode() and decode_unchecked() to RawValue as provided methods
// once Rust has lazy normalization and/or GATs.

View File

@ -1,5 +1,4 @@
use crate::database::{HasOutput, HasRawValue};
use crate::{decode, encode, Database, Decode, Encode, RawValue, TypeInfo};
use crate::{Database, Decode, Encode, TypeInfo};
/// Indicates that a SQL type is supported for a database.
pub trait Type<Db: Database> {

View File

@ -1,7 +1,7 @@
use std::sync::Arc;
use bytes::Bytes;
use sqlx_core::{ColumnIndex, Decode, Error, Result, Row, TypeDecode};
use sqlx_core::{ColumnIndex, Result, Row, TypeDecode};
use crate::{protocol, MySql, MySqlColumn, MySqlRawValue, MySqlRawValueFormat};
@ -42,12 +42,12 @@ impl MySqlRow {
}
/// Returns the column at the index, if available.
fn column<I: ColumnIndex<Self>>(&self, index: I) -> &MySqlColumn {
pub fn column<I: ColumnIndex<Self>>(&self, index: I) -> &MySqlColumn {
Row::column(self, index)
}
/// Returns the column at the index, if available.
fn try_column<I: ColumnIndex<Self>>(&self, index: I) -> Result<&MySqlColumn> {
pub fn try_column<I: ColumnIndex<Self>>(&self, index: I) -> Result<&MySqlColumn> {
Ok(&self.columns[index.get(self)?])
}

View File

@ -1,6 +1,3 @@
use std::str::from_utf8_unchecked;
use bytes::Bytes;
use bytestring::ByteString;
use sqlx_core::{decode, encode, Decode, Encode, Type};

View File

@ -77,7 +77,9 @@ macro_rules! impl_type_uint {
}
impl Encode<MySql> for $ty {
fn encode(&self, _ty: &MySqlTypeInfo, out: &mut MySqlOutput<'_>) -> encode::Result<()> {
fn encode(&self, ty: &MySqlTypeInfo, out: &mut MySqlOutput<'_>) -> encode::Result<()> {
ensure_not_too_large((*self).into(), ty)?;
out.buffer().extend_from_slice(&self.to_le_bytes());
Ok(())