Skip to content

Commit

Permalink
shm clippy still fails
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Apr 23, 2024
1 parent 618bed1 commit d103085
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
21 changes: 14 additions & 7 deletions zenoh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
);
Expand Down Expand Up @@ -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,
};
}
13 changes: 1 addition & 12 deletions zenoh/tests/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 1 addition & 6 deletions zenoh/tests/shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d103085

Please sign in to comment.