diff --git a/sbroad-core/src/backend/sql/space.rs b/sbroad-core/src/backend/sql/space.rs index 19a919b832cd89c176a41fdc362060926012c4de..3dab220448da66681da87379a38057b40ea9437c 100644 --- a/sbroad-core/src/backend/sql/space.rs +++ b/sbroad-core/src/backend/sql/space.rs @@ -4,17 +4,17 @@ use crate::executor::ir::ExecutionPlan; use crate::ir::relation::SpaceEngine; #[cfg(not(feature = "mock"))] -use crate::error; -#[cfg(not(feature = "mock"))] -use crate::errors::{Action, Entity}; -#[cfg(not(feature = "mock"))] -use crate::ir::value::EncodedValue; -#[cfg(not(feature = "mock"))] -use tarantool::index::{FieldType, IndexOptions, IndexType, Part}; -#[cfg(not(feature = "mock"))] -use tarantool::space::{Field, Space, SpaceCreateOptions}; +mod prod_imports { + pub use crate::error; + pub use crate::errors::{Action, Entity}; + pub use crate::ir::value::EncodedValue; + pub use tarantool::index::{FieldType, IndexOptions, IndexType, Part}; + pub use tarantool::space::{Field, Space, SpaceCreateOptions}; + pub use tarantool::tuple::Tuple; +} + #[cfg(not(feature = "mock"))] -use tarantool::tuple::Tuple; +use prod_imports::*; #[allow(clippy::module_name_repetitions)] #[derive(Hash, Eq, PartialEq, Debug)] diff --git a/sbroad-core/src/otm.rs b/sbroad-core/src/otm.rs index 48dc469dcd7498ea5c2b44e28095e0ec615d3e7a..0d189c0f910fdee89eeba447b7f3dd6773b657c3 100644 --- a/sbroad-core/src/otm.rs +++ b/sbroad-core/src/otm.rs @@ -27,17 +27,19 @@ use std::cell::RefCell; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; -mod fiber; +pub mod fiber; pub mod statistics; #[cfg(not(feature = "mock"))] -use crate::warn; -#[cfg(not(feature = "mock"))] -use fiber::fiber_id; -#[cfg(not(feature = "mock"))] -use tarantool::error::Error as TntError; +mod prod_imports { + pub use crate::warn; + pub use crate::otm::fiber::fiber_id; + pub use tarantool::error::Error as TntError; + pub use tarantool::transaction::start_transaction; +} + #[cfg(not(feature = "mock"))] -use tarantool::transaction::start_transaction; +use prod_imports::*; static TRACER_NAME: &str = "libsbroad"; static RATIO: f64 = 0.01; diff --git a/sbroad-core/src/otm/fiber.rs b/sbroad-core/src/otm/fiber.rs index 0430bef15dc7cfaa151f987ee939579592850a38..17d106f056a813cfbb8158ce0abb4eacbb2e8fd6 100644 --- a/sbroad-core/src/otm/fiber.rs +++ b/sbroad-core/src/otm/fiber.rs @@ -1,5 +1,5 @@ #[cfg(not(feature = "mock"))] -pub(super) fn fiber_id() -> u64 { +pub fn fiber_id() -> u64 { let lua = tarantool::lua_state(); lua.get::<tarantool::tlua::LuaFunction<_>, _>("fiber_id")