From d851078eae6ac1eb490a95234ae5937f49dc5d4b Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 7 Dec 2021 11:49:23 +0100 Subject: [PATCH] shared-memory: clippy fixes (docs) Signed-off-by: Wolfgang Bumiller --- proxmox-shared-memory/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proxmox-shared-memory/src/lib.rs b/proxmox-shared-memory/src/lib.rs index 39f7cfef..2a99a81e 100644 --- a/proxmox-shared-memory/src/lib.rs +++ b/proxmox-shared-memory/src/lib.rs @@ -192,12 +192,21 @@ impl SharedMemory { } /// Helper to initialize nested data +/// +/// # Safety +/// +/// This calls `Init::initialize`, it is up to the user to ensure this is safe. The value should +/// not have been initialized at this point. pub unsafe fn initialize_subtype(this: &mut T) { let data: &mut MaybeUninit = std::mem::transmute(this); Init::initialize(data); } /// Helper to call 'check_type_magic' for nested data +/// +/// # Safety +/// +/// This calls `Init::check_type_magic`, it is up to the user to ensure this is safe. pub unsafe fn check_subtype(this: &T) -> Result<(), Error> { let data: &MaybeUninit = std::mem::transmute(this); Init::check_type_magic(data)