From 76c84554d9bdfbf6d3cc91247b76239a1ad9b371 Mon Sep 17 00:00:00 2001 From: Micah Johnston Date: Wed, 9 Oct 2024 23:31:36 -0500 Subject: [PATCH] fix clippy lint for missing transmute annotations --- src/gl/win.rs | 3 +++ src/gl/x11.rs | 2 ++ src/win/drop_target.rs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/gl/win.rs b/src/gl/win.rs index 655a8071..7e4289c8 100644 --- a/src/gl/win.rs +++ b/src/gl/win.rs @@ -160,6 +160,7 @@ impl GlContext { let symbol = CString::new("wglCreateContextAttribsARB").unwrap(); let addr = wglGetProcAddress(symbol.as_ptr()); if !addr.is_null() { + #[allow(clippy::missing_transmute_annotations)] Some(std::mem::transmute(addr)) } else { None @@ -171,6 +172,7 @@ impl GlContext { let symbol = CString::new("wglChoosePixelFormatARB").unwrap(); let addr = wglGetProcAddress(symbol.as_ptr()); if !addr.is_null() { + #[allow(clippy::missing_transmute_annotations)] Some(std::mem::transmute(addr)) } else { None @@ -182,6 +184,7 @@ impl GlContext { let symbol = CString::new("wglSwapIntervalEXT").unwrap(); let addr = wglGetProcAddress(symbol.as_ptr()); if !addr.is_null() { + #[allow(clippy::missing_transmute_annotations)] Some(std::mem::transmute(addr)) } else { None diff --git a/src/gl/x11.rs b/src/gl/x11.rs index d4498014..b7aaca47 100644 --- a/src/gl/x11.rs +++ b/src/gl/x11.rs @@ -91,6 +91,7 @@ impl GlContext { if addr.is_null() { return Err(GlError::CreationFailed(CreationFailedError::GetProcAddressFailed)); } else { + #[allow(clippy::missing_transmute_annotations)] std::mem::transmute(addr) } }; @@ -101,6 +102,7 @@ impl GlContext { if addr.is_null() { return Err(GlError::CreationFailed(CreationFailedError::GetProcAddressFailed)); } else { + #[allow(clippy::missing_transmute_annotations)] std::mem::transmute(addr) } }; diff --git a/src/win/drop_target.rs b/src/win/drop_target.rs index aa42259a..be19f79d 100644 --- a/src/win/drop_target.rs +++ b/src/win/drop_target.rs @@ -47,6 +47,8 @@ const DROP_PTR: unsafe extern "system" fn( pt: POINTL, pdwEffect: *mut DWORD, ) -> HRESULT = DropTarget::drop; + +#[allow(clippy::missing_transmute_annotations)] const DROP_TARGET_VTBL: IDropTargetVtbl = IDropTargetVtbl { parent: IUnknownVtbl { QueryInterface: DropTarget::query_interface,