From f8aa8232c7e3ec70302cd8e958f5404454174a8a Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 25 Oct 2024 14:50:26 +0100 Subject: [PATCH] Cleanup --- sdk/pinocchio/src/lazy_entrypoint.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/pinocchio/src/lazy_entrypoint.rs b/sdk/pinocchio/src/lazy_entrypoint.rs index d33c746..86304de 100644 --- a/sdk/pinocchio/src/lazy_entrypoint.rs +++ b/sdk/pinocchio/src/lazy_entrypoint.rs @@ -166,14 +166,12 @@ impl InstructionContext { /// before reading all accounts will result in undefined behavior. #[inline(always)] pub unsafe fn instruction_data_unchecked(&mut self) -> (&[u8], &Pubkey) { - let data_len = unsafe { *(self.input.add(self.offset) as *const usize) }; + let data_len = *(self.input.add(self.offset) as *const usize); // shadowing the offset to avoid leaving it in an inconsistent state let offset = self.offset + core::mem::size_of::(); - let data = unsafe { core::slice::from_raw_parts(self.input.add(offset), data_len) }; + let data = core::slice::from_raw_parts(self.input.add(offset), data_len); - (data, unsafe { - &*(self.input.add(offset + data_len) as *const Pubkey) - }) + (data, &*(self.input.add(offset + data_len) as *const Pubkey)) } }