From ebe3d3e3e3edf550df7bb1291948b4153ca5f84a Mon Sep 17 00:00:00 2001 From: msiglreith Date: Wed, 13 Jan 2021 18:48:43 +0100 Subject: [PATCH] Mark windows fields as nonzero --- src/windows.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/windows.rs b/src/windows.rs index 41cffb3..43b6393 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,5 +1,5 @@ use core::ffi::c_void; -use core::ptr; +use core::ptr::NonNull; /// Raw window handle for Windows. /// @@ -14,9 +14,9 @@ use core::ptr; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WindowsHandle { /// A Win32 HWND handle. - pub hwnd: *mut c_void, + pub hwnd: Option>, /// The HINSTANCE associated with this type's HWND. - pub hinstance: *mut c_void, + pub hinstance: Option>, #[doc(hidden)] #[deprecated = "This field is used to ensure that this struct is non-exhaustive, so that it may be extended in the future. Do not refer to this field."] pub _non_exhaustive_do_not_use: crate::seal::Seal, @@ -26,8 +26,8 @@ impl WindowsHandle { pub fn empty() -> WindowsHandle { #[allow(deprecated)] WindowsHandle { - hwnd: ptr::null_mut(), - hinstance: ptr::null_mut(), + hwnd: None, + hinstance: None, _non_exhaustive_do_not_use: crate::seal::Seal, } }