diff --git a/iceoryx-sys/src/chunk_header.rs b/iceoryx-sys/src/chunk_header.rs index 30bdb74..2de051d 100644 --- a/iceoryx-sys/src/chunk_header.rs +++ b/iceoryx-sys/src/chunk_header.rs @@ -27,7 +27,7 @@ impl ChunkHeader { !chunk_header.is_null(), "The ChunkHeader ptr should always be non-null when the payload ptr was non-null!" ); - &*(chunk_header as *const Self) + &*(chunk_header.cast::()) } } diff --git a/iceoryx-sys/src/sample.rs b/iceoryx-sys/src/sample.rs index 9494373..759ba8d 100644 --- a/iceoryx-sys/src/sample.rs +++ b/iceoryx-sys/src/sample.rs @@ -61,7 +61,7 @@ impl RawSample { #[inline] pub fn chunk_header(&self) -> &ChunkHeader { // SAFTEY: `self.as_payload_ptr` returns a non-null ptr - unsafe { ChunkHeader::from_user_payload_unchecked(self.as_payload_ptr() as *const c_void) } + unsafe { ChunkHeader::from_user_payload_unchecked(self.as_payload_ptr().cast::()) } } } @@ -169,7 +169,7 @@ impl RawSampleMut { #[inline] pub fn chunk_header(&self) -> &ChunkHeader { // SAFTEY: `self.as_payload_ptr` returns a non-null ptr - unsafe { ChunkHeader::from_user_payload_unchecked(self.as_payload_ptr() as *const c_void) } + unsafe { ChunkHeader::from_user_payload_unchecked(self.as_payload_ptr().cast::()) } } }