mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-25 10:31:37 +08:00
Remove #[macro_use] attribute when importing macros
This commit is contained in:
parent
4e36b55b31
commit
d229f0f9e9
@ -137,7 +137,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
#[ignore] // FIXME: unstable
|
#[ignore] // FIXME: unstable
|
||||||
fn test_busy_handler() {
|
fn test_busy_handler() {
|
||||||
lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref CALLED: AtomicBool = AtomicBool::new(false);
|
static ref CALLED: AtomicBool = AtomicBool::new(false);
|
||||||
}
|
}
|
||||||
fn busy_handler(_: i32) -> bool {
|
fn busy_handler(_: i32) -> bool {
|
||||||
|
@ -237,6 +237,7 @@ mod test {
|
|||||||
use super::Action;
|
use super::Action;
|
||||||
use crate::Connection;
|
use crate::Connection;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_commit_hook() {
|
fn test_commit_hook() {
|
||||||
|
@ -58,12 +58,6 @@
|
|||||||
|
|
||||||
pub use libsqlite3_sys as ffi;
|
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::cell::RefCell;
|
||||||
use std::convert;
|
use std::convert;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
@ -761,7 +755,7 @@ impl fmt::Debug for Connection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags! {
|
bitflags::bitflags! {
|
||||||
#[doc = "Flags for opening SQLite database connections."]
|
#[doc = "Flags for opening SQLite database connections."]
|
||||||
#[doc = "See [sqlite3_open_v2](http://www.sqlite.org/c3ref/open.html) for details."]
|
#[doc = "See [sqlite3_open_v2](http://www.sqlite.org/c3ref/open.html) for details."]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -822,7 +822,7 @@ mod test {
|
|||||||
db.execute_batch("CREATE TABLE foo(t TEXT PRIMARY KEY NOT NULL);")
|
db.execute_batch("CREATE TABLE foo(t TEXT PRIMARY KEY NOT NULL);")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref CALLED: AtomicBool = AtomicBool::new(false);
|
static ref CALLED: AtomicBool = AtomicBool::new(false);
|
||||||
}
|
}
|
||||||
db.apply(
|
db.apply(
|
||||||
|
@ -124,6 +124,7 @@ impl Connection {
|
|||||||
mod test {
|
mod test {
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
use crate::Connection;
|
use crate::Connection;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ pub fn load_module(conn: &Connection) -> Result<()> {
|
|||||||
conn.create_module("rarray", &ARRAY_MODULE, aux)
|
conn.create_module("rarray", &ARRAY_MODULE, aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref ARRAY_MODULE: Module<ArrayTab> = eponymous_only_module::<ArrayTab>(1);
|
static ref ARRAY_MODULE: Module<ArrayTab> = eponymous_only_module::<ArrayTab>(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ pub fn load_module(conn: &Connection) -> Result<()> {
|
|||||||
conn.create_module("csv", &CSV_MODULE, aux)
|
conn.create_module("csv", &CSV_MODULE, aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref CSV_MODULE: Module<CSVTab> = read_only_module::<CSVTab>(1);
|
static ref CSV_MODULE: Module<CSVTab> = read_only_module::<CSVTab>(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ pub trait CreateVTab: VTab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags! {
|
bitflags::bitflags! {
|
||||||
#[doc = "Index constraint operator."]
|
#[doc = "Index constraint operator."]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct IndexConstraintOp: ::std::os::raw::c_uchar {
|
pub struct IndexConstraintOp: ::std::os::raw::c_uchar {
|
||||||
|
@ -18,7 +18,7 @@ pub fn load_module(conn: &Connection) -> Result<()> {
|
|||||||
conn.create_module("generate_series", &SERIES_MODULE, aux)
|
conn.create_module("generate_series", &SERIES_MODULE, aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref SERIES_MODULE: Module<SeriesTab> = eponymous_only_module::<SeriesTab>(1);
|
static ref SERIES_MODULE: Module<SeriesTab> = eponymous_only_module::<SeriesTab>(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ const SERIES_COLUMN_START: c_int = 1;
|
|||||||
const SERIES_COLUMN_STOP: c_int = 2;
|
const SERIES_COLUMN_STOP: c_int = 2;
|
||||||
const SERIES_COLUMN_STEP: c_int = 3;
|
const SERIES_COLUMN_STEP: c_int = 3;
|
||||||
|
|
||||||
bitflags! {
|
bitflags::bitflags! {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct QueryPlanFlags: ::std::os::raw::c_int {
|
struct QueryPlanFlags: ::std::os::raw::c_int {
|
||||||
// start = $value -- constraint exists
|
// start = $value -- constraint exists
|
||||||
|
@ -2,14 +2,11 @@
|
|||||||
//! function affects SQLite process-wide and so is not safe to run as a normal
|
//! function affects SQLite process-wide and so is not safe to run as a normal
|
||||||
//! #[test] in the library.
|
//! #[test] in the library.
|
||||||
|
|
||||||
#[cfg(feature = "trace")]
|
|
||||||
#[macro_use]
|
|
||||||
extern crate lazy_static;
|
|
||||||
|
|
||||||
#[cfg(feature = "trace")]
|
#[cfg(feature = "trace")]
|
||||||
fn main() {
|
fn main() {
|
||||||
use std::os::raw::c_int;
|
use std::os::raw::c_int;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref LOGS_RECEIVED: Mutex<Vec<(c_int, String)>> = Mutex::new(Vec::new());
|
static ref LOGS_RECEIVED: Mutex<Vec<(c_int, String)>> = Mutex::new(Vec::new());
|
||||||
|
Loading…
Reference in New Issue
Block a user