diff --git a/Cargo.toml b/Cargo.toml index 3d2068e..94abf17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "rusqlite" version = "0.15.0" authors = ["John Gallagher "] +edition = "2018" description = "Ergonomic wrapper for SQLite" repository = "https://github.com/jgallagher/rusqlite" documentation = "http://docs.rs/rusqlite/" diff --git a/libsqlite3-sys/Cargo.toml b/libsqlite3-sys/Cargo.toml index ba51d57..7f0457d 100644 --- a/libsqlite3-sys/Cargo.toml +++ b/libsqlite3-sys/Cargo.toml @@ -2,6 +2,7 @@ name = "libsqlite3-sys" version = "0.10.0" authors = ["John Gallagher "] +edition = "2018" repository = "https://github.com/jgallagher/rusqlite" description = "Native bindings to the libsqlite3 library" license = "MIT" diff --git a/src/backup.rs b/src/backup.rs index 05d0b43..250e0c8 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -37,10 +37,10 @@ use std::os::raw::c_int; use std::thread; use std::time::Duration; -use ffi; +use crate::ffi; -use error::{error_from_handle, error_from_sqlite_code}; -use {Connection, DatabaseName, Result}; +use crate::error::{error_from_handle, error_from_sqlite_code}; +use crate::{Connection, DatabaseName, Result}; impl Connection { /// Back up the `name` database to the given destination path. @@ -303,8 +303,8 @@ impl<'a, 'b> Drop for Backup<'a, 'b> { #[cfg(test)] mod test { use super::Backup; + use crate::{Connection, DatabaseName, NO_PARAMS}; use std::time::Duration; - use {Connection, DatabaseName, NO_PARAMS}; #[test] fn test_backup() { diff --git a/src/blob.rs b/src/blob.rs index c5c5b6f..0b41a5f 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -64,7 +64,7 @@ use std::ptr; use super::ffi; use super::types::{ToSql, ToSqlOutput}; -use {Connection, DatabaseName, Result}; +use crate::{Connection, DatabaseName, Result}; /// Handle to an open BLOB. pub struct Blob<'conn> { @@ -262,8 +262,8 @@ impl ToSql for ZeroBlob { #[cfg(test)] mod test { + use crate::{Connection, DatabaseName, Result}; use std::io::{BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; - use {Connection, DatabaseName, Result}; fn db_with_test_blob() -> Result<(Connection, i64)> { let db = Connection::open_in_memory()?; diff --git a/src/busy.rs b/src/busy.rs index 84a810b..dc7a889 100644 --- a/src/busy.rs +++ b/src/busy.rs @@ -4,8 +4,8 @@ use std::os::raw::{c_int, c_void}; use std::ptr; use std::time::Duration; -use ffi; -use {Connection, InnerConnection, Result}; +use crate::ffi; +use crate::{Connection, InnerConnection, Result}; impl Connection { /// Set a busy handler that sleeps for a specified amount of time when a @@ -81,7 +81,7 @@ mod test { use std::thread; use std::time::Duration; - use {Connection, Error, ErrorCode, TransactionBehavior, NO_PARAMS}; + use crate::{Connection, Error, ErrorCode, TransactionBehavior, NO_PARAMS}; #[test] fn test_default_busy() { diff --git a/src/cache.rs b/src/cache.rs index a142db8..8dc3912 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,10 +1,10 @@ //! Prepared statements cache for faster execution. +use crate::raw_statement::RawStatement; +use crate::{Connection, Result, Statement}; use lru_cache::LruCache; -use raw_statement::RawStatement; use std::cell::RefCell; use std::ops::{Deref, DerefMut}; -use {Connection, Result, Statement}; impl Connection { /// Prepare a SQL statement for execution, returning a previously prepared @@ -152,7 +152,7 @@ impl StatementCache { #[cfg(test)] mod test { use super::StatementCache; - use {Connection, NO_PARAMS}; + use crate::{Connection, NO_PARAMS}; impl StatementCache { fn clear(&self) { diff --git a/src/context.rs b/src/context.rs index e4ce95a..9834a7d 100644 --- a/src/context.rs +++ b/src/context.rs @@ -5,14 +5,14 @@ use std::os::raw::{c_char, c_int, c_void}; #[cfg(feature = "array")] use std::rc::Rc; -use ffi; -use ffi::sqlite3_context; -use ffi::sqlite3_value; +use crate::ffi; +use crate::ffi::sqlite3_context; +use crate::ffi::sqlite3_value; -use str_to_cstring; -use types::{ToSqlOutput, ValueRef}; +use crate::str_to_cstring; +use crate::types::{ToSqlOutput, ValueRef}; #[cfg(feature = "array")] -use vtab::array::{free_array, ARRAY_TYPE}; +use crate::vtab::array::{free_array, ARRAY_TYPE}; impl<'a> ValueRef<'a> { pub(crate) unsafe fn from_value(value: *mut sqlite3_value) -> ValueRef<'a> { diff --git a/src/error.rs b/src/error.rs index a480453..8f324dd 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,14 +1,14 @@ +use crate::types::Type; +use crate::{errmsg_to_string, ffi}; use std::error; use std::fmt; use std::os::raw::c_int; use std::path::PathBuf; use std::str; -use types::Type; -use {errmsg_to_string, ffi}; /// Enum listing possible errors from rusqlite. #[derive(Debug)] -#[allow(enum_variant_names)] +#[allow(clippy::enum_variant_names)] pub enum Error { /// An error from an underlying SQLite call. SqliteFailure(ffi::Error, Option), diff --git a/src/functions.rs b/src/functions.rs index 4f9527c..5e141a4 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -58,14 +58,14 @@ use std::os::raw::{c_int, c_void}; use std::ptr; use std::slice; -use ffi; -use ffi::sqlite3_context; -use ffi::sqlite3_value; +use crate::ffi; +use crate::ffi::sqlite3_context; +use crate::ffi::sqlite3_value; -use context::set_result; -use types::{FromSql, FromSqlError, ToSql, ValueRef}; +use crate::context::set_result; +use crate::types::{FromSql, FromSqlError, ToSql, ValueRef}; -use {str_to_cstring, Connection, Error, InnerConnection, Result}; +use crate::{str_to_cstring, Connection, Error, InnerConnection, Result}; unsafe fn report_error(ctx: *mut sqlite3_context, err: &Error) { // Extended constraint error codes were added in SQLite 3.7.16. We don't have @@ -198,14 +198,14 @@ where /// "step" function called once for each row in an aggregate group. May be /// called 0 times if there are no rows. - fn step(&self, &mut Context, &mut A) -> Result<()>; + fn step(&self, _: &mut Context, _: &mut A) -> Result<()>; /// Computes and returns the final result. Will be called exactly once for /// each invocation of the function. If `step()` was called at least /// once, will be given `Some(A)` (the same `A` as was created by /// `init` and given to `step`); if `step()` was not called (because /// the function is running against 0 rows), will be given `None`. - fn finalize(&self, Option) -> Result; + fn finalize(&self, _: Option) -> Result; } impl Connection { @@ -490,8 +490,8 @@ mod test { use std::f64::EPSILON; use std::os::raw::c_double; - use functions::{Aggregate, Context}; - use {Connection, Error, Result, NO_PARAMS}; + use crate::functions::{Aggregate, Context}; + use crate::{Connection, Error, Result, NO_PARAMS}; fn half(ctx: &Context) -> Result { assert!(ctx.len() == 1, "called with unexpected number of arguments"); diff --git a/src/hooks.rs b/src/hooks.rs index c36b313..947e7f4 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -4,9 +4,9 @@ use std::os::raw::{c_char, c_int, c_void}; use std::ptr; -use ffi; +use crate::ffi; -use {Connection, InnerConnection}; +use crate::{Connection, InnerConnection}; /// Authorizer Action Codes #[derive(Debug, PartialEq)] @@ -289,8 +289,8 @@ fn free_boxed_hook(p: *mut c_void) { #[cfg(test)] mod test { use super::Action; + use crate::Connection; use std::sync::atomic::{AtomicBool, Ordering}; - use Connection; #[test] fn test_commit_hook() { diff --git a/src/lib.rs b/src/lib.rs index 99f7f16..e5165e8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,27 +88,27 @@ use std::str; use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT}; use std::sync::{Arc, Mutex, Once, ONCE_INIT}; -use cache::StatementCache; -use error::{error_from_handle, error_from_sqlite_code}; -use raw_statement::RawStatement; -use types::{ToSql, ValueRef}; +use crate::cache::StatementCache; +use crate::error::{error_from_handle, error_from_sqlite_code}; +use crate::raw_statement::RawStatement; +use crate::types::{ToSql, ValueRef}; -pub use statement::Statement; +pub use crate::statement::Statement; -pub use row::{AndThenRows, MappedRows, Row, RowIndex, Rows}; +pub use crate::row::{AndThenRows, MappedRows, Row, RowIndex, Rows}; -pub use transaction::{DropBehavior, Savepoint, Transaction, TransactionBehavior}; +pub use crate::transaction::{DropBehavior, Savepoint, Transaction, TransactionBehavior}; -pub use error::Error; -pub use ffi::ErrorCode; +pub use crate::error::Error; +pub use crate::ffi::ErrorCode; -pub use cache::CachedStatement; -pub use version::*; +pub use crate::cache::CachedStatement; +pub use crate::version::*; #[cfg(feature = "hooks")] -pub use hooks::*; +pub use crate::hooks::*; #[cfg(feature = "load_extension")] -pub use load_extension_guard::LoadExtensionGuard; +pub use crate::load_extension_guard::LoadExtensionGuard; #[cfg(feature = "backup")] pub mod backup; @@ -1058,7 +1058,7 @@ mod test { extern crate tempdir; use self::tempdir::TempDir; pub use super::*; - use ffi; + use crate::ffi; pub use std::error::Error as StdError; pub use std::fmt; @@ -1548,9 +1548,7 @@ mod test { for (i, v) in vals.iter().enumerate() { let i_to_insert = i as i64; assert_eq!( - insert_stmt - .execute(&[&i_to_insert as &dyn ToSql, &v]) - .unwrap(), + insert_stmt.execute(&[&i_to_insert as &ToSql, &v]).unwrap(), 1 ); } diff --git a/src/limits.rs b/src/limits.rs index d8fc2b0..cbe9beb 100644 --- a/src/limits.rs +++ b/src/limits.rs @@ -2,10 +2,10 @@ use std::os::raw::c_int; -use ffi; -pub use ffi::Limit; +use crate::ffi; +pub use crate::ffi::Limit; -use Connection; +use crate::Connection; impl Connection { /// Returns the current value of a limit. @@ -23,8 +23,8 @@ impl Connection { #[cfg(test)] mod test { - use ffi::Limit; - use Connection; + use crate::ffi::Limit; + use crate::Connection; #[test] fn test_limit() { @@ -57,13 +57,13 @@ mod test { assert_eq!(99, db.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER)); // SQLITE_LIMIT_TRIGGER_DEPTH was added in SQLite 3.6.18. - if ::version_number() >= 3006018 { + if crate::version_number() >= 3006018 { db.set_limit(Limit::SQLITE_LIMIT_TRIGGER_DEPTH, 32); assert_eq!(32, db.limit(Limit::SQLITE_LIMIT_TRIGGER_DEPTH)); } // SQLITE_LIMIT_WORKER_THREADS was added in SQLite 3.8.7. - if ::version_number() >= 3008007 { + if crate::version_number() >= 3008007 { db.set_limit(Limit::SQLITE_LIMIT_WORKER_THREADS, 2); assert_eq!(2, db.limit(Limit::SQLITE_LIMIT_WORKER_THREADS)); } diff --git a/src/load_extension_guard.rs b/src/load_extension_guard.rs index 0b46a76..49fafff 100644 --- a/src/load_extension_guard.rs +++ b/src/load_extension_guard.rs @@ -1,4 +1,4 @@ -use {Connection, Result}; +use crate::{Connection, Result}; /// RAII guard temporarily enabling SQLite extensions to be loaded. /// diff --git a/src/row.rs b/src/row.rs index af7728b..545e190 100644 --- a/src/row.rs +++ b/src/row.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use std::{convert, result}; use super::{Error, Result, Statement}; -use types::{FromSql, FromSqlError, ValueRef}; +use crate::types::{FromSql, FromSqlError, ValueRef}; /// An handle for the resulting rows of a query. pub struct Rows<'stmt> { @@ -27,7 +27,7 @@ impl<'stmt> Rows<'stmt> { /// This is a "streaming iterator". For a more natural interface, /// consider using `query_map` or `query_and_then` instead, which /// return types that implement `Iterator`. - #[cfg_attr(feature = "cargo-clippy", allow(should_implement_trait))] // cannot implement Iterator + #[allow(clippy::should_implement_trait)] // cannot implement Iterator pub fn next<'a>(&'a mut self) -> Option>> { self.stmt.and_then(|stmt| match stmt.step() { Ok(true) => Some(Ok(Row { diff --git a/src/statement.rs b/src/statement.rs index 28aac6d..ce49943 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -11,9 +11,9 @@ use super::str_to_cstring; use super::{ AndThenRows, Connection, Error, MappedRows, RawStatement, Result, Row, Rows, ValueRef, }; -use types::{ToSql, ToSqlOutput}; +use crate::types::{ToSql, ToSqlOutput}; #[cfg(feature = "array")] -use vtab::array::{free_array, ARRAY_TYPE}; +use crate::vtab::array::{free_array, ARRAY_TYPE}; /// A prepared statement. pub struct Statement<'conn> { @@ -668,7 +668,7 @@ impl<'conn> Statement<'conn> { #[cfg(test)] mod test { - use {Connection, Error, Result, NO_PARAMS}; + use crate::{Connection, Error, Result, NO_PARAMS}; #[test] fn test_execute_named() { diff --git a/src/trace.rs b/src/trace.rs index a11396b..810b8d0 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -7,8 +7,8 @@ use std::ptr; use std::time::Duration; use super::ffi; -use error::error_from_sqlite_code; -use {Connection, Result}; +use crate::error::error_from_sqlite_code; +use crate::{Connection, Result}; /// Set up the process-wide SQLite error logging callback. /// This function is marked unsafe for two reasons: @@ -124,7 +124,7 @@ mod test { use std::sync::Mutex; use std::time::Duration; - use Connection; + use crate::Connection; #[test] fn test_trace() { diff --git a/src/transaction.rs b/src/transaction.rs index ac4dd9a..4907aaf 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -1,5 +1,5 @@ +use crate::{Connection, Result}; use std::ops::Deref; -use {Connection, Result}; /// Options for transaction behavior. See [BEGIN /// TRANSACTION](http://www.sqlite.org/lang_transaction.html) for details. @@ -410,7 +410,7 @@ impl Connection { #[cfg(test)] mod test { use super::DropBehavior; - use {Connection, NO_PARAMS}; + use crate::{Connection, NO_PARAMS}; fn checked_memory_handle() -> Connection { let db = Connection::open_in_memory().unwrap(); diff --git a/src/types/chrono.rs b/src/types/chrono.rs index 2835f92..776a55c 100644 --- a/src/types/chrono.rs +++ b/src/types/chrono.rs @@ -5,8 +5,8 @@ use std::borrow::Cow; use self::chrono::{DateTime, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc}; -use types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; -use Result; +use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; +use crate::Result; /// ISO 8601 calendar date without timezone => "YYYY-MM-DD" impl ToSql for NaiveDate { @@ -132,7 +132,7 @@ mod test { use super::chrono::{ DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc, }; - use {Connection, Result, NO_PARAMS}; + use crate::{Connection, Result, NO_PARAMS}; fn checked_memory_handle() -> Connection { let db = Connection::open_in_memory().unwrap(); diff --git a/src/types/from_sql.rs b/src/types/from_sql.rs index 8f7e132..4feefdf 100644 --- a/src/types/from_sql.rs +++ b/src/types/from_sql.rs @@ -47,7 +47,7 @@ impl Error for FromSqlError { } } - #[cfg_attr(feature = "clippy", allow(match_same_arms))] + #[allow(clippy::match_same_arms)] fn cause(&self) -> Option<&Error> { match *self { FromSqlError::Other(ref err) => err.cause(), @@ -181,7 +181,7 @@ impl FromSql for Value { #[cfg(test)] mod test { use super::FromSql; - use {Connection, Error}; + use crate::{Connection, Error}; fn checked_memory_handle() -> Connection { Connection::open_in_memory().unwrap() diff --git a/src/types/mod.rs b/src/types/mod.rs index 009f865..0d19dc1 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -114,9 +114,9 @@ mod test { extern crate time; use super::Value; + use crate::{Connection, Error, NO_PARAMS}; use std::f64::EPSILON; use std::os::raw::{c_double, c_int}; - use {Connection, Error, NO_PARAMS}; fn checked_memory_handle() -> Connection { let db = Connection::open_in_memory().unwrap(); diff --git a/src/types/serde_json.rs b/src/types/serde_json.rs index dc3fc26..33cc8f6 100644 --- a/src/types/serde_json.rs +++ b/src/types/serde_json.rs @@ -3,8 +3,8 @@ extern crate serde_json; use self::serde_json::Value; -use types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; -use Result; +use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; +use crate::Result; /// Serialize JSON `Value` to text. impl ToSql for Value { @@ -28,8 +28,8 @@ impl FromSql for Value { #[cfg(test)] mod test { use super::serde_json; - use types::ToSql; - use {Connection, NO_PARAMS}; + use crate::types::ToSql; + use crate::{Connection, NO_PARAMS}; fn checked_memory_handle() -> Connection { let db = Connection::open_in_memory().unwrap(); diff --git a/src/types/time.rs b/src/types/time.rs index 980d846..1fd0524 100644 --- a/src/types/time.rs +++ b/src/types/time.rs @@ -1,7 +1,7 @@ extern crate time; -use types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; -use Result; +use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; +use crate::Result; const CURRENT_TIMESTAMP_FMT: &str = "%Y-%m-%d %H:%M:%S"; const SQLITE_DATETIME_FMT: &str = "%Y-%m-%dT%H:%M:%S.%fZ"; @@ -37,7 +37,7 @@ impl FromSql for time::Timespec { #[cfg(test)] mod test { use super::time; - use {Connection, Result, NO_PARAMS}; + use crate::{Connection, Result, NO_PARAMS}; fn checked_memory_handle() -> Connection { let db = Connection::open_in_memory().unwrap(); diff --git a/src/types/to_sql.rs b/src/types/to_sql.rs index 2793ba1..81df0d9 100644 --- a/src/types/to_sql.rs +++ b/src/types/to_sql.rs @@ -1,8 +1,8 @@ use super::{Null, Value, ValueRef}; -use std::borrow::Cow; #[cfg(feature = "array")] -use vtab::array::Array; -use Result; +use crate::vtab::array::Array; +use crate::Result; +use std::borrow::Cow; /// `ToSqlOutput` represents the possible output types for implementors of the /// `ToSql` trait. @@ -207,8 +207,8 @@ mod test { #[cfg(feature = "i128_blob")] #[test] fn test_i128() { + use crate::{Connection, NO_PARAMS}; use std::i128; - use {Connection, NO_PARAMS}; let db = Connection::open_in_memory().unwrap(); db.execute_batch("CREATE TABLE foo (i128 BLOB, desc TEXT)") .unwrap(); diff --git a/src/types/value_ref.rs b/src/types/value_ref.rs index cd99bb2..50f9b17 100644 --- a/src/types/value_ref.rs +++ b/src/types/value_ref.rs @@ -1,5 +1,5 @@ use super::{Type, Value}; -use types::{FromSqlError, FromSqlResult}; +use crate::types::{FromSqlError, FromSqlResult}; /// A non-owning [dynamic type value](http://sqlite.org/datatype3.html). Typically the /// memory backing this value is owned by SQLite. diff --git a/src/unlock_notify.rs b/src/unlock_notify.rs index c4f2f1f..0f8f6fa 100644 --- a/src/unlock_notify.rs +++ b/src/unlock_notify.rs @@ -6,7 +6,7 @@ use std::os::raw::c_void; #[cfg(feature = "unlock_notify")] use std::sync::{Condvar, Mutex}; -use ffi; +use crate::ffi; #[cfg(feature = "unlock_notify")] struct UnlockNotification { @@ -99,10 +99,10 @@ pub fn wait_for_unlock_notify(_db: *mut ffi::sqlite3) -> c_int { #[cfg(feature = "unlock_notify")] #[cfg(test)] mod test { + use crate::{Connection, OpenFlags, Result, Transaction, TransactionBehavior, NO_PARAMS}; use std::sync::mpsc::sync_channel; use std::thread; use std::time; - use {Connection, OpenFlags, Result, Transaction, TransactionBehavior, NO_PARAMS}; #[test] fn test_unlock_notify() { diff --git a/src/version.rs b/src/version.rs index 39c7d6b..215900b 100644 --- a/src/version.rs +++ b/src/version.rs @@ -1,4 +1,4 @@ -use ffi; +use crate::ffi; use std::ffi::CStr; /// Returns the SQLite version as an integer; e.g., `3016002` for version diff --git a/src/vtab/array.rs b/src/vtab/array.rs index a6256d0..672e34d 100644 --- a/src/vtab/array.rs +++ b/src/vtab/array.rs @@ -5,13 +5,13 @@ use std::default::Default; use std::os::raw::{c_char, c_int, c_void}; use std::rc::Rc; -use ffi; -use types::{ToSql, ToSqlOutput, Value}; -use vtab::{ +use crate::ffi; +use crate::types::{ToSql, ToSqlOutput, Value}; +use crate::vtab::{ eponymous_only_module, Context, IndexConstraintOp, IndexInfo, Module, VTab, VTabConnection, VTabCursor, Values, }; -use {Connection, Result}; +use crate::{Connection, Result}; // http://sqlite.org/bindptr.html @@ -169,10 +169,10 @@ impl VTabCursor for ArrayTabCursor { #[cfg(test)] mod test { + use crate::types::Value; + use crate::vtab::array; + use crate::Connection; use std::rc::Rc; - use types::Value; - use vtab::array; - use Connection; #[test] fn test_array_module() { diff --git a/src/vtab/csvtab.rs b/src/vtab/csvtab.rs index 520cbfd..c289843 100644 --- a/src/vtab/csvtab.rs +++ b/src/vtab/csvtab.rs @@ -8,13 +8,13 @@ use std::path::Path; use std::result; use std::str; -use ffi; -use types::Null; -use vtab::{ +use crate::ffi; +use crate::types::Null; +use crate::vtab::{ dequote, escape_double_quote, parse_boolean, read_only_module, Context, CreateVTab, IndexInfo, Module, VTab, VTabConnection, VTabCursor, Values, }; -use {Connection, Error, Result}; +use crate::{Connection, Error, Result}; /// Register the "csv" module. /// ```sql @@ -340,8 +340,8 @@ impl From for Error { #[cfg(test)] mod test { - use vtab::csvtab; - use {Connection, Result, NO_PARAMS}; + use crate::vtab::csvtab; + use crate::{Connection, Result, NO_PARAMS}; #[test] fn test_csv_module() { diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 613ded2..d7cf6e5 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -17,12 +17,12 @@ use std::os::raw::{c_char, c_int, c_void}; use std::ptr; use std::slice; -use context::set_result; -use error::error_from_sqlite_code; -use ffi; -pub use ffi::{sqlite3_vtab, sqlite3_vtab_cursor}; -use types::{FromSql, FromSqlError, ToSql, ValueRef}; -use {str_to_cstring, Connection, Error, InnerConnection, Result}; +use crate::context::set_result; +use crate::error::error_from_sqlite_code; +use crate::ffi; +pub use crate::ffi::{sqlite3_vtab, sqlite3_vtab_cursor}; +use crate::types::{FromSql, FromSqlError, ToSql, ValueRef}; +use crate::{str_to_cstring, Connection, Error, InnerConnection, Result}; // let conn: Connection = ...; // let mod: Module = ...; // VTab builder @@ -476,7 +476,7 @@ impl<'a> Values<'a> { // So it seems not possible to enhance `ValueRef::from_value`. #[cfg(feature = "array")] pub(crate) fn get_array(&self, idx: usize) -> Result> { - use types::Value; + use crate::types::Value; let arg = self.args[idx]; let ptr = unsafe { ffi::sqlite3_value_pointer(arg, array::ARRAY_TYPE) }; if ptr.is_null() { diff --git a/src/vtab/series.rs b/src/vtab/series.rs index 2313755..716719d 100644 --- a/src/vtab/series.rs +++ b/src/vtab/series.rs @@ -4,13 +4,13 @@ use std::default::Default; use std::os::raw::c_int; -use ffi; -use types::Type; -use vtab::{ +use crate::ffi; +use crate::types::Type; +use crate::vtab::{ eponymous_only_module, Context, IndexConstraintOp, IndexInfo, Module, VTab, VTabConnection, VTabCursor, Values, }; -use {Connection, Result}; +use crate::{Connection, Result}; /// Register the "generate_series" module. pub fn load_module(conn: &Connection) -> Result<()> { @@ -263,9 +263,9 @@ impl VTabCursor for SeriesTabCursor { #[cfg(test)] mod test { - use ffi; - use vtab::series; - use {Connection, NO_PARAMS}; + use crate::ffi; + use crate::vtab::series; + use crate::{Connection, NO_PARAMS}; #[test] fn test_series_module() {