From c09d8e1442ae098a3c1d17bcb3dd1737b47ac81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Jan 2021 11:39:45 +0100 Subject: [PATCH] clippy: use std::ptr::null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- proxmox/src/tools/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/src/tools/mod.rs b/proxmox/src/tools/mod.rs index ff3a720a..45f46f9d 100644 --- a/proxmox/src/tools/mod.rs +++ b/proxmox/src/tools/mod.rs @@ -37,7 +37,7 @@ pub use as_any::AsAny; #[macro_export] macro_rules! offsetof { ($ty:ty, $field:ident) => { - unsafe { &(*(0 as *const $ty)).$field as *const _ as usize } + unsafe { &(*(std::ptr::null::<$ty>())).$field as *const _ as usize } }; }