Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 6cd1c36

Browse files
committed
gdkwayland: Cast void pointer to the actual type before calling Box::from_raw()
warning: creating a `Box` from a void raw pointer --> gdkwayland/src/wayland_window.rs:53:21 | 53 | let _ = Box::from_raw(data as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: cast this to a pointer of the appropriate type --> gdkwayland/src/wayland_window.rs:53:35 | 53 | let _ = Box::from_raw(data as *mut _); | ^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_raw_with_void_ptr
1 parent fa13039 commit 6cd1c36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gdkwayland/src/wayland_window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ impl WaylandWindow {
4444
) {
4545
let window = from_glib_borrow(window);
4646
let handle: Borrowed<glib::GString> = from_glib_borrow(handle);
47-
let callback: &P = &*(user_data as *mut _);
47+
let callback = &*(user_data as *mut P);
4848
(*callback)(&window, handle.as_str());
4949
}
5050
unsafe extern "C" fn destroy_notify<P: Fn(&WaylandWindow, &str) + 'static>(
5151
data: glib::ffi::gpointer,
5252
) {
53-
let _ = Box::from_raw(data as *mut _);
53+
let _ = Box::from_raw(data as *mut P);
5454
}
5555
unsafe {
5656
from_glib(ffi::gdk_wayland_window_export_handle(

0 commit comments

Comments
 (0)