Skip to content

Commit

Permalink
Mark windows fields as nonzero
Browse files Browse the repository at this point in the history
  • Loading branch information
msiglreith committed Jan 13, 2021
1 parent 8e8e2e0 commit ebe3d3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/windows.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::ffi::c_void;
use core::ptr;
use core::ptr::NonNull;

/// Raw window handle for Windows.
///
Expand All @@ -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<NonNull<c_void>>,
/// The HINSTANCE associated with this type's HWND.
pub hinstance: *mut c_void,
pub hinstance: Option<NonNull<c_void>>,
#[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,
Expand All @@ -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,
}
}
Expand Down

0 comments on commit ebe3d3e

Please sign in to comment.