diff --git a/src/busy.rs b/src/busy.rs index f801e3f..b9bfc65 100644 --- a/src/busy.rs +++ b/src/busy.rs @@ -137,7 +137,7 @@ mod test { #[test] #[ignore] // FIXME: unstable fn test_busy_handler() { - lazy_static! { + lazy_static::lazy_static! { static ref CALLED: AtomicBool = AtomicBool::new(false); } fn busy_handler(_: i32) -> bool { diff --git a/src/hooks.rs b/src/hooks.rs index 3131462..946407a 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -237,6 +237,7 @@ mod test { use super::Action; use crate::Connection; use std::sync::atomic::{AtomicBool, Ordering}; + use lazy_static::lazy_static; #[test] fn test_commit_hook() { diff --git a/src/lib.rs b/src/lib.rs index d7883529..31c483c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,12 +58,6 @@ pub use libsqlite3_sys as ffi; -#[macro_use] -extern crate bitflags; -#[cfg(any(test, feature = "vtab"))] -#[macro_use] -extern crate lazy_static; - use std::cell::RefCell; use std::convert; use std::default::Default; @@ -761,7 +755,7 @@ impl fmt::Debug for Connection { } } -bitflags! { +bitflags::bitflags! { #[doc = "Flags for opening SQLite database connections."] #[doc = "See [sqlite3_open_v2](http://www.sqlite.org/c3ref/open.html) for details."] #[repr(C)] diff --git a/src/session.rs b/src/session.rs index 4ff88b6..bce3e1a 100644 --- a/src/session.rs +++ b/src/session.rs @@ -822,7 +822,7 @@ mod test { db.execute_batch("CREATE TABLE foo(t TEXT PRIMARY KEY NOT NULL);") .unwrap(); - lazy_static! { + lazy_static::lazy_static! { static ref CALLED: AtomicBool = AtomicBool::new(false); } db.apply( diff --git a/src/trace.rs b/src/trace.rs index 8af3f27..d6f3969 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -124,6 +124,7 @@ impl Connection { mod test { use std::sync::Mutex; use std::time::Duration; + use lazy_static::lazy_static; use crate::Connection; diff --git a/src/vtab/array.rs b/src/vtab/array.rs index 1b4bd46..5a572a1 100644 --- a/src/vtab/array.rs +++ b/src/vtab/array.rs @@ -35,7 +35,7 @@ pub fn load_module(conn: &Connection) -> Result<()> { conn.create_module("rarray", &ARRAY_MODULE, aux) } -lazy_static! { +lazy_static::lazy_static! { static ref ARRAY_MODULE: Module = eponymous_only_module::(1); } diff --git a/src/vtab/csvtab.rs b/src/vtab/csvtab.rs index bf092b0..acae3fc 100644 --- a/src/vtab/csvtab.rs +++ b/src/vtab/csvtab.rs @@ -32,7 +32,7 @@ pub fn load_module(conn: &Connection) -> Result<()> { conn.create_module("csv", &CSV_MODULE, aux) } -lazy_static! { +lazy_static::lazy_static! { static ref CSV_MODULE: Module = read_only_module::(1); } diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 2a7191d..5ec10ca 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -234,7 +234,7 @@ pub trait CreateVTab: VTab { } } -bitflags! { +bitflags::bitflags! { #[doc = "Index constraint operator."] #[repr(C)] pub struct IndexConstraintOp: ::std::os::raw::c_uchar { diff --git a/src/vtab/series.rs b/src/vtab/series.rs index 722ed4b..c0d1100 100644 --- a/src/vtab/series.rs +++ b/src/vtab/series.rs @@ -18,7 +18,7 @@ pub fn load_module(conn: &Connection) -> Result<()> { conn.create_module("generate_series", &SERIES_MODULE, aux) } -lazy_static! { +lazy_static::lazy_static! { static ref SERIES_MODULE: Module = eponymous_only_module::(1); } @@ -28,7 +28,7 @@ const SERIES_COLUMN_START: c_int = 1; const SERIES_COLUMN_STOP: c_int = 2; const SERIES_COLUMN_STEP: c_int = 3; -bitflags! { +bitflags::bitflags! { #[repr(C)] struct QueryPlanFlags: ::std::os::raw::c_int { // start = $value -- constraint exists diff --git a/tests/config_log.rs b/tests/config_log.rs index d51acf5..aa90b94 100644 --- a/tests/config_log.rs +++ b/tests/config_log.rs @@ -2,14 +2,11 @@ //! function affects SQLite process-wide and so is not safe to run as a normal //! #[test] in the library. -#[cfg(feature = "trace")] -#[macro_use] -extern crate lazy_static; - #[cfg(feature = "trace")] fn main() { use std::os::raw::c_int; use std::sync::Mutex; + use lazy_static::lazy_static; lazy_static! { static ref LOGS_RECEIVED: Mutex> = Mutex::new(Vec::new());