From d10308568c7fb0444ea3412259bf344cafd0f8dc Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Tue, 23 Apr 2024 11:51:10 +0200 Subject: [PATCH] shm clippy still fails --- zenoh/src/lib.rs | 21 ++++++++++++++------- zenoh/tests/payload.rs | 13 +------------ zenoh/tests/shm.rs | 7 +------ 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/zenoh/src/lib.rs b/zenoh/src/lib.rs index 47c95f2d52..c4f671ec79 100644 --- a/zenoh/src/lib.rs +++ b/zenoh/src/lib.rs @@ -82,11 +82,6 @@ extern crate zenoh_result; mod api; mod net; -#[cfg(all(feature = "unstable", feature = "shared-memory"))] -pub use zenoh_shm::api as shm; -#[cfg(all(feature = "unstable", feature = "shared-memory"))] -pub use zenoh_shm::api::client_storage::SharedMemoryClientStorage; - lazy_static::lazy_static!( static ref LONG_VERSION: String = format!("{} built with {}", GIT_VERSION, env!("RUSTC_VERSION")); ); @@ -366,7 +361,19 @@ pub mod internal { pub use zenoh_util::{zenoh_home, Timed, TimedEvent, Timer, ZENOH_HOME_ENV_VAR}; } -#[cfg(feature = "shared-memory")] +#[cfg(all(feature = "unstable", feature = "shared-memory"))] pub mod shm { - pub use zenoh_shm::SharedMemoryManager; + pub use zenoh_shm::api::client_storage::SharedMemoryClientStorage; + pub use zenoh_shm::api::slice::zsliceshm::{zsliceshm, ZSliceShm}; + pub use zenoh_shm::api::slice::zsliceshmmut::{zsliceshmmut, ZSliceShmMut}; + pub use zenoh_shm::api::{ + protocol_implementations::posix::{ + posix_shared_memory_provider_backend::PosixSharedMemoryProviderBackend, + protocol_id::POSIX_PROTOCOL_ID, + }, + provider::shared_memory_provider::SharedMemoryProviderBuilder, + }; + pub use zenoh_shm::api::provider::shared_memory_provider::{ + BlockOn, GarbageCollect, + }; } diff --git a/zenoh/tests/payload.rs b/zenoh/tests/payload.rs index d9910bedf5..fac5d37367 100644 --- a/zenoh/tests/payload.rs +++ b/zenoh/tests/payload.rs @@ -15,18 +15,7 @@ #[test] #[cfg(all(feature = "shared-memory", feature = "unstable"))] fn shm_payload_single_buf() { - use zenoh::shm::slice::zsliceshm::{zsliceshm, ZSliceShm}; - use zenoh::shm::slice::zsliceshmmut::{zsliceshmmut, ZSliceShmMut}; - use zenoh::{ - bytes::ZBytes, - shm::{ - protocol_implementations::posix::{ - posix_shared_memory_provider_backend::PosixSharedMemoryProviderBackend, - protocol_id::POSIX_PROTOCOL_ID, - }, - provider::shared_memory_provider::SharedMemoryProviderBuilder, - }, - }; + use zenoh::prelude::r#async::*; // create an SHM backend... let backend = PosixSharedMemoryProviderBackend::builder() diff --git a/zenoh/tests/shm.rs b/zenoh/tests/shm.rs index 2a9685eb36..92d1b17732 100644 --- a/zenoh/tests/shm.rs +++ b/zenoh/tests/shm.rs @@ -17,12 +17,7 @@ mod tests { use std::sync::Arc; use std::time::Duration; use zenoh::prelude::r#async::*; - use zenoh::shm::protocol_implementations::posix::posix_shared_memory_provider_backend::PosixSharedMemoryProviderBackend; - use zenoh::shm::protocol_implementations::posix::protocol_id::POSIX_PROTOCOL_ID; - use zenoh::shm::provider::shared_memory_provider::{ - BlockOn, GarbageCollect, SharedMemoryProviderBuilder, - }; - use zenoh_core::ztimeout; + use zenoh::internal::ztimeout; const TIMEOUT: Duration = Duration::from_secs(60); const SLEEP: Duration = Duration::from_secs(1);