From 62c92c28f804c8fd46640a03a7d98017a69e0f52 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 2 Sep 2023 14:02:35 -0700 Subject: [PATCH] Fix CI issues Signed-off-by: John Nunley --- src/android.rs | 4 ++-- src/appkit.rs | 4 ++-- src/haiku.rs | 4 ++-- src/lib.rs | 4 ++-- src/redox.rs | 4 ++-- src/uikit.rs | 4 ++-- src/unix.rs | 20 ++++++++++---------- src/web.rs | 22 ++++++++++++---------- src/windows.rs | 6 +++--- 9 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/android.rs b/src/android.rs index 3afe70b..fc10ecb 100644 --- a/src/android.rs +++ b/src/android.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for Android. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct AndroidDisplayHandle {} impl AndroidDisplayHandle { @@ -23,7 +23,7 @@ impl AndroidDisplayHandle { /// Raw window handle for Android NDK. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct AndroidNdkWindowHandle { /// A pointer to an `ANativeWindow`. pub a_native_window: NonNull, diff --git a/src/appkit.rs b/src/appkit.rs index ec9a66c..3b05810 100644 --- a/src/appkit.rs +++ b/src/appkit.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for AppKit. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct AppKitDisplayHandle {} impl AppKitDisplayHandle { @@ -23,7 +23,7 @@ impl AppKitDisplayHandle { /// Raw window handle for AppKit. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct AppKitWindowHandle { /// A pointer to an `NSView` object. pub ns_view: NonNull, diff --git a/src/haiku.rs b/src/haiku.rs index f35696b..ef010ee 100644 --- a/src/haiku.rs +++ b/src/haiku.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for Haiku. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct HaikuDisplayHandle {} impl HaikuDisplayHandle { @@ -23,7 +23,7 @@ impl HaikuDisplayHandle { /// Raw window handle for Haiku. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct HaikuWindowHandle { /// A pointer to a BWindow object pub b_window: NonNull, diff --git a/src/lib.rs b/src/lib.rs index 9aa7bc9..60a36a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,7 +123,7 @@ unsafe impl HasRawWindowHandle for alloc::sync:: /// [`RawWindowHandle::Xlib`] on macOS, it would just be weird, and probably /// requires something like XQuartz be used). #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum RawWindowHandle { /// A raw window handle for UIKit (Apple's non-macOS windowing library). /// @@ -291,7 +291,7 @@ unsafe impl HasRawDisplayHandle for alloc::sync /// [`RawDisplayHandle::Xlib`] on macOS, it would just be weird, and probably /// requires something like XQuartz be used). #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum RawDisplayHandle { /// A raw display handle for UIKit (Apple's non-macOS windowing library). /// diff --git a/src/redox.rs b/src/redox.rs index 6a65977..7562756 100644 --- a/src/redox.rs +++ b/src/redox.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for the Redox operating system. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct OrbitalDisplayHandle {} impl OrbitalDisplayHandle { @@ -23,7 +23,7 @@ impl OrbitalDisplayHandle { /// Raw window handle for the Redox operating system. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct OrbitalWindowHandle { /// A pointer to an orbclient window. // TODO(madsmtm): I think this is a file descriptor, so perhaps it should diff --git a/src/uikit.rs b/src/uikit.rs index 4a442b6..1f4895e 100644 --- a/src/uikit.rs +++ b/src/uikit.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for UIKit. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct UiKitDisplayHandle {} impl UiKitDisplayHandle { @@ -23,7 +23,7 @@ impl UiKitDisplayHandle { /// Raw window handle for UIKit. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct UiKitWindowHandle { /// A pointer to an `UIView` object. pub ui_view: NonNull, diff --git a/src/unix.rs b/src/unix.rs index 246116d..e1d5023 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -4,7 +4,7 @@ use core::ptr::NonNull; /// Raw display handle for Xlib. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct XlibDisplayHandle { /// A pointer to an Xlib `Display`. /// @@ -44,7 +44,7 @@ impl XlibDisplayHandle { /// Raw window handle for Xlib. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct XlibWindowHandle { /// An Xlib `Window`. pub window: c_ulong, @@ -78,7 +78,7 @@ impl XlibWindowHandle { /// Raw display handle for Xcb. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct XcbDisplayHandle { /// A pointer to an X server `xcb_connection_t`. /// @@ -118,7 +118,7 @@ impl XcbDisplayHandle { /// Raw window handle for Xcb. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct XcbWindowHandle { /// An X11 `xcb_window_t`. pub window: NonZeroU32, // Based on xproto.h @@ -152,7 +152,7 @@ impl XcbWindowHandle { /// Raw display handle for Wayland. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WaylandDisplayHandle { /// A pointer to a `wl_display`. pub display: NonNull, @@ -180,7 +180,7 @@ impl WaylandDisplayHandle { /// Raw window handle for Wayland. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WaylandWindowHandle { /// A pointer to a `wl_surface`. pub surface: NonNull, @@ -208,7 +208,7 @@ impl WaylandWindowHandle { /// Raw display handle for the Linux Kernel Mode Set/Direct Rendering Manager. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct DrmDisplayHandle { /// The drm file descriptor. // TODO: Use `std::os::fd::RawFd`? @@ -235,7 +235,7 @@ impl DrmDisplayHandle { /// Raw window handle for the Linux Kernel Mode Set/Direct Rendering Manager. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct DrmWindowHandle { /// The primary drm plane handle. pub plane: u32, @@ -261,7 +261,7 @@ impl DrmWindowHandle { /// Raw display handle for the Linux Generic Buffer Manager. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct GbmDisplayHandle { /// The gbm device. pub gbm_device: NonNull, @@ -289,7 +289,7 @@ impl GbmDisplayHandle { /// Raw window handle for the Linux Generic Buffer Manager. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct GbmWindowHandle { /// The gbm surface. pub gbm_surface: NonNull, diff --git a/src/web.rs b/src/web.rs index e7895c2..da65980 100644 --- a/src/web.rs +++ b/src/web.rs @@ -3,7 +3,7 @@ use core::ptr::NonNull; /// Raw display handle for the Web. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WebDisplayHandle {} impl WebDisplayHandle { @@ -23,7 +23,7 @@ impl WebDisplayHandle { /// Raw window handle for the Web. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WebWindowHandle { /// An ID value inserted into the [data attributes] of the canvas element as '`raw-handle`'. /// @@ -56,16 +56,17 @@ impl WebWindowHandle { /// /// ## Construction /// ```no_run -/// # use raw_window_handle::{Wbg02CanvasWindowHandle, Wbg02Object}; -/// # fn get_canvas() -> Wbg02Object { unimplemented!() } -/// let obj: Wbg02Object = get_canvas(); +/// # use raw_window_handle::Wbg02CanvasWindowHandle; +/// # use core::{ffi::c_void, ptr::NonNull}; +/// # fn get_canvas() -> NonNull { unimplemented!() } +/// let obj: NonNull = get_canvas(); /// let mut window_handle = Wbg02CanvasWindowHandle::new(obj); /// /* set fields */ /// ``` /// /// [`wasm-bindgen`]: https://crates.io/crates/wasm-bindgen #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Wbg02CanvasWindowHandle { /// The object representing the [`HtmlCanvasElement`]. /// @@ -133,16 +134,17 @@ impl Wbg02CanvasWindowHandle { /// /// ## Construction /// ```no_run -/// # use raw_window_handle::{Wbg02OffscreenCanvasWindowHandle, Wbg02Object}; -/// # fn get_offscreen_canvas() -> Wbg02Object { unimplemented!() } -/// let obj: Wbg02Object = get_offscreen_canvas(); +/// # use raw_window_handle::Wbg02OffscreenCanvasWindowHandle; +/// # use core::{ffi::c_void, ptr::NonNull}; +/// # fn get_offscreen_canvas() -> NonNull { unimplemented!() } +/// let obj: NonNull = get_offscreen_canvas(); /// let mut window_handle = Wbg02OffscreenCanvasWindowHandle::new(obj); /// /* set fields */ /// ``` /// /// [`wasm-bindgen`]: https://crates.io/crates/wasm-bindgen #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Wbg02OffscreenCanvasWindowHandle { /// The object representing the [`OffscreenCanvas`]. /// diff --git a/src/windows.rs b/src/windows.rs index 457639e..9751dbf 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -6,7 +6,7 @@ use core::ptr::NonNull; /// /// It can be used regardless of Windows window backend. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WindowsDisplayHandle {} impl WindowsDisplayHandle { @@ -26,7 +26,7 @@ impl WindowsDisplayHandle { /// Raw window handle for Win32. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Win32WindowHandle { /// A Win32 `HWND` handle. pub hwnd: NonZeroIsize, @@ -64,7 +64,7 @@ impl Win32WindowHandle { /// Raw window handle for WinRT. #[non_exhaustive] -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct WinRtWindowHandle { /// A WinRT `CoreWindow` handle. pub core_window: NonNull,