Skip to content

Commit

Permalink
[#532] Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Dec 4, 2024
1 parent 3b0e930 commit 182901f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion iceoryx2-cal/src/resizable_shared_memory/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions iceoryx2-cal/src/shm_allocator/pool_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ impl<Service: service::Service, Payload: Debug + ?Sized, UserHeader: Debug>
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);

Expand Down

0 comments on commit 182901f

Please sign in to comment.