mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-19 22:10:50 +08:00
Cleanup use statements
This commit is contained in:
parent
28a48ec7c1
commit
08e32444c9
@ -82,7 +82,7 @@ mod build_bundled {
|
|||||||
// There may be other platforms that don't support `isnan`, they should be
|
// There may be other platforms that don't support `isnan`, they should be
|
||||||
// tested for here.
|
// tested for here.
|
||||||
if cfg!(target_env = "msvc") {
|
if cfg!(target_env = "msvc") {
|
||||||
use self::cc::windows_registry::{find_vs_version, VsVers};
|
use cc::windows_registry::{find_vs_version, VsVers};
|
||||||
let vs_has_nan = match find_vs_version() {
|
let vs_has_nan = match find_vs_version() {
|
||||||
Ok(ver) => ver != VsVers::Vs12,
|
Ok(ver) => ver != VsVers::Vs12,
|
||||||
Err(_msg) => false,
|
Err(_msg) => false,
|
||||||
@ -298,8 +298,8 @@ mod bindings {
|
|||||||
mod bindings {
|
mod bindings {
|
||||||
use bindgen;
|
use bindgen;
|
||||||
|
|
||||||
use self::bindgen::callbacks::{IntKind, ParseCallbacks};
|
|
||||||
use super::HeaderLocation;
|
use super::HeaderLocation;
|
||||||
|
use bindgen::callbacks::{IntKind, ParseCallbacks};
|
||||||
|
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
@ -75,12 +75,11 @@ impl InnerConnection {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use self::tempdir::TempDir;
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc::sync_channel;
|
use std::sync::mpsc::sync_channel;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tempdir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
use crate::{Connection, Error, ErrorCode, Result, TransactionBehavior, NO_PARAMS};
|
use crate::{Connection, Error, ErrorCode, Result, TransactionBehavior, NO_PARAMS};
|
||||||
|
|
||||||
|
@ -682,9 +682,7 @@ where
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use regex;
|
use regex::Regex;
|
||||||
|
|
||||||
use self::regex::Regex;
|
|
||||||
use std::f64::EPSILON;
|
use std::f64::EPSILON;
|
||||||
use std::os::raw::c_double;
|
use std::os::raw::c_double;
|
||||||
|
|
||||||
|
@ -850,13 +850,12 @@ unsafe fn db_filename(_: *mut ffi::sqlite3) -> Option<PathBuf> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use self::tempdir::TempDir;
|
use super::*;
|
||||||
pub use super::*;
|
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use fallible_iterator::FallibleIterator;
|
use fallible_iterator::FallibleIterator;
|
||||||
pub use std::error::Error as StdError;
|
use std::error::Error as StdError;
|
||||||
pub use std::fmt;
|
use std::fmt;
|
||||||
use tempdir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
// this function is never called, but is still type checked; in
|
// this function is never called, but is still type checked; in
|
||||||
// particular, calls with specific instantiations will require
|
// particular, calls with specific instantiations will require
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
//! Convert most of the [Time Strings](http://sqlite.org/lang_datefunc.html) to chrono types.
|
//! Convert most of the [Time Strings](http://sqlite.org/lang_datefunc.html) to chrono types.
|
||||||
use chrono;
|
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use self::chrono::{DateTime, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
|
use chrono::{DateTime, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
|
||||||
|
|
||||||
use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef};
|
use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef};
|
||||||
use crate::Result;
|
use crate::Result;
|
||||||
@ -129,10 +128,8 @@ impl FromSql for DateTime<Local> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::chrono::{
|
|
||||||
DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc,
|
|
||||||
};
|
|
||||||
use crate::{Connection, Result, NO_PARAMS};
|
use crate::{Connection, Result, NO_PARAMS};
|
||||||
|
use chrono::{DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
|
||||||
|
|
||||||
fn checked_memory_handle() -> Connection {
|
fn checked_memory_handle() -> Connection {
|
||||||
let db = Connection::open_in_memory().unwrap();
|
let db = Connection::open_in_memory().unwrap();
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
//! `ToSql` and `FromSql` implementation for JSON `Value`.
|
//! `ToSql` and `FromSql` implementation for JSON `Value`.
|
||||||
use serde_json;
|
|
||||||
|
|
||||||
use self::serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef};
|
use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef};
|
||||||
use crate::Result;
|
use crate::Result;
|
||||||
@ -27,9 +26,9 @@ impl FromSql for Value {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::serde_json;
|
|
||||||
use crate::types::ToSql;
|
use crate::types::ToSql;
|
||||||
use crate::{Connection, NO_PARAMS};
|
use crate::{Connection, NO_PARAMS};
|
||||||
|
use serde_json;
|
||||||
|
|
||||||
fn checked_memory_handle() -> Connection {
|
fn checked_memory_handle() -> Connection {
|
||||||
let db = Connection::open_in_memory().unwrap();
|
let db = Connection::open_in_memory().unwrap();
|
||||||
|
@ -36,8 +36,8 @@ impl FromSql for time::Timespec {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::time;
|
|
||||||
use crate::{Connection, Result, NO_PARAMS};
|
use crate::{Connection, Result, NO_PARAMS};
|
||||||
|
use time;
|
||||||
|
|
||||||
fn checked_memory_handle() -> Connection {
|
fn checked_memory_handle() -> Connection {
|
||||||
let db = Connection::open_in_memory().unwrap();
|
let db = Connection::open_in_memory().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user