mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
style: remove unused imports
This commit is contained in:
parent
f6655c827a
commit
85c11b3f2f
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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> {
|
||||
|
||||
@ -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)?])
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
use std::str::from_utf8_unchecked;
|
||||
|
||||
use bytes::Bytes;
|
||||
use bytestring::ByteString;
|
||||
use sqlx_core::{decode, encode, Decode, Encode, Type};
|
||||
|
||||
|
||||
@ -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(())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user