From 0595593f98f7554ff5053994634cc1b9ae37870e Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 12 Feb 2026 12:37:56 -0500 Subject: [PATCH] Remove unnecessary unsafe. Signed-off-by: Josh Matthews --- src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 819dd5e..9c997c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -204,16 +204,12 @@ impl RawSmallVec { #[inline] const fn as_ptr_inline(&self) -> *const T { - // SAFETY: This is safe because we don't read the value. We only get a pointer to the data. - // Dereferencing the pointer is unsafe so unsafe code is required to misuse the return - // value. - (unsafe { addr_of!(self.inline) }) as *const T + addr_of!(self.inline) as *const T } #[inline] const fn as_mut_ptr_inline(&mut self) -> *mut T { - // SAFETY: See above. - (unsafe { addr_of_mut!(self.inline) }) as *mut T + addr_of_mut!(self.inline) as *mut T } /// # Safety