From e4da5c0d4b2e0d85ef5b6b212e07f752be1f93d6 Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 3 Sep 2021 18:08:45 +0300 Subject: [PATCH] remove externs --- src/connection.rs | 3 +-- src/it_generator.rs | 2 -- src/sqlite3_connector/import_functions.rs | 4 +--- src/statement.rs | 4 ++-- src/test.rs | 19 +++++++++++-------- tests/tests.rs | 4 +--- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index 871842e..bf6cd45 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -1,10 +1,9 @@ use crate::sqlite3_connector as ffi; +use crate::{Result, Statement}; use std::marker::PhantomData; use std::path::Path; -use crate::{Result, Statement}; - /// A database connection. pub struct Connection { raw: ffi::Sqlite3DbHandle, diff --git a/src/it_generator.rs b/src/it_generator.rs index 424e41a..81b9c6d 100644 --- a/src/it_generator.rs +++ b/src/it_generator.rs @@ -1,8 +1,6 @@ #![allow(unused_variables)] #![allow(non_snake_case)] -extern crate marine_rs_sdk; - use marine_rs_sdk::marine; pub fn main() {} diff --git a/src/sqlite3_connector/import_functions.rs b/src/sqlite3_connector/import_functions.rs index 7848c0c..c888b20 100644 --- a/src/sqlite3_connector/import_functions.rs +++ b/src/sqlite3_connector/import_functions.rs @@ -1,6 +1,4 @@ -extern crate marine_rs_sdk; - -use self::marine_rs_sdk::marine; +use marine_rs_sdk::marine; pub(crate) type Sqlite3DbHandle = u32; pub(crate) type Sqlite3StmtHandle = u32; diff --git a/src/statement.rs b/src/statement.rs index 79db5ab..5e00d3b 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -1,8 +1,8 @@ use crate::sqlite3_connector as ffi; -use std::marker::PhantomData; - use crate::{Cursor, Result, Type, Value}; +use std::marker::PhantomData; + /// A prepared statement. pub struct Statement { raw: (ffi::Sqlite3StmtHandle, ffi::Sqlite3DbHandle), diff --git a/src/test.rs b/src/test.rs index e1d2002..8d88717 100644 --- a/src/test.rs +++ b/src/test.rs @@ -1,6 +1,3 @@ -extern crate marine_rs_sdk; -extern crate marine_sqlite_connector; - use marine_rs_sdk::marine; use marine_sqlite_connector::State; @@ -100,7 +97,8 @@ pub fn test4() { .unwrap(); let mut cursor = connection - .prepare("INSERT OR REPLACE INTO test VALUES (?, ?)").unwrap(); + .prepare("INSERT OR REPLACE INTO test VALUES (?, ?)") + .unwrap(); cursor.bind(1, &Value::Integer(50)).unwrap(); cursor.bind(2, &Value::Binary(vec![1, 2, 3])).unwrap(); @@ -123,7 +121,8 @@ pub fn test5() { .unwrap(); let mut cursor = connection - .prepare("INSERT OR REPLACE INTO test VALUES (?, ?)").unwrap(); + .prepare("INSERT OR REPLACE INTO test VALUES (?, ?)") + .unwrap(); cursor.bind(1, &Value::Integer(50)).unwrap(); cursor.bind(2, &Value::Binary(vec![1, 2, 3])).unwrap(); @@ -138,8 +137,12 @@ pub fn test5() { cursor.bind(&[Value::Integer(50)]).unwrap(); while let Some(row) = cursor.next().unwrap() { - if vec![1,2 ,3] != row[0].as_binary().unwrap().to_vec() { - println!("expected: {:?}, actual: {:?}", vec![1,2 ,3], row[0].as_binary().unwrap()); + if vec![1, 2, 3] != row[0].as_binary().unwrap().to_vec() { + println!( + "expected: {:?}, actual: {:?}", + vec![1, 2, 3], + row[0].as_binary().unwrap() + ); } } -} \ No newline at end of file +} diff --git a/tests/tests.rs b/tests/tests.rs index fff9f05..2440511 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -29,13 +29,11 @@ mod tests { test.test2() } - #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts/")] fn test3(test: marine_test_env::test::ModuleInterface) { test.test3() } - #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts/")] fn test4(test: marine_test_env::test::ModuleInterface) { test.test4() @@ -45,4 +43,4 @@ mod tests { fn test5(test: marine_test_env::test::ModuleInterface) { test.test5() } -} \ No newline at end of file +}