From 182901f677dff60dcc0ef954721bbbeccc96f0ad Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Wed, 4 Dec 2024 15:21:35 +0100 Subject: [PATCH] [#532] Fix clippy warnings --- iceoryx2-cal/src/resizable_shared_memory/dynamic.rs | 2 +- iceoryx2-cal/src/shm_allocator/pool_allocator.rs | 3 +++ iceoryx2/src/port/publisher.rs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iceoryx2-cal/src/resizable_shared_memory/dynamic.rs b/iceoryx2-cal/src/resizable_shared_memory/dynamic.rs index 2ac046933..dc9a28194 100644 --- a/iceoryx2-cal/src/resizable_shared_memory/dynamic.rs +++ b/iceoryx2-cal/src/resizable_shared_memory/dynamic.rs @@ -315,7 +315,7 @@ where } let old_key = SlotMapKey::new(old_idx); - if let Some(ref shm) = shared_memory_map.get(old_key) { + if let Some(shm) = shared_memory_map.get(old_key) { if shm.chunk_count.load(Ordering::Relaxed) == 0 { shared_memory_map.remove(old_key); } diff --git a/iceoryx2-cal/src/shm_allocator/pool_allocator.rs b/iceoryx2-cal/src/shm_allocator/pool_allocator.rs index 401fff4d7..8511b9884 100644 --- a/iceoryx2-cal/src/shm_allocator/pool_allocator.rs +++ b/iceoryx2-cal/src/shm_allocator/pool_allocator.rs @@ -57,6 +57,9 @@ impl PoolAllocator { self.allocator.number_of_buckets() } + /// # Safety + /// + /// * provided [`PointerOffset`] must be allocated with [`PoolAllocator::allocate()`] pub unsafe fn deallocate_bucket(&self, offset: PointerOffset) { self.number_of_used_buckets.fetch_sub(1, Ordering::Relaxed); self.allocator.deallocate_bucket(NonNull::new_unchecked( diff --git a/iceoryx2/src/port/publisher.rs b/iceoryx2/src/port/publisher.rs index 1450a09b9..ee9e9e024 100644 --- a/iceoryx2/src/port/publisher.rs +++ b/iceoryx2/src/port/publisher.rs @@ -662,7 +662,7 @@ impl let global_config = service.__internal_state().shared_node.config(); let data_segment = fail!(from origin, - when DataSegment::create(&publisher_details, &global_config, sample_layout, config.allocation_strategy), + when DataSegment::create(&publisher_details, global_config, sample_layout, config.allocation_strategy), with PublisherCreateError::UnableToCreateDataSegment, "{} since the data segment could not be acquired.", msg);