From ccd9186c9fef717de88c2ed2fae80df071cf1027 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 27 Sep 2024 13:17:43 -0700 Subject: [PATCH] Fix clippy `unnecessary_cast` lint Removed the case where `bindings.rs` defined the constants as `u32`, but allowed the lint where it instead uses a type alias defined as `libc::c_uint` (which tecnically may not be 32-bit). --- src/buffer_object.rs | 2 ++ src/device.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/buffer_object.rs b/src/buffer_object.rs index b16c8a6..610851f 100644 --- a/src/buffer_object.rs +++ b/src/buffer_object.rs @@ -1,3 +1,5 @@ +#![allow(clippy::unnecessary_cast)] + use crate::{AsRaw, Device, DeviceDestroyedError, Format, Modifier, Ptr, WeakPtr}; #[cfg(feature = "drm-support")] diff --git a/src/device.rs b/src/device.rs index b5aa670..ca39918 100644 --- a/src/device.rs +++ b/src/device.rs @@ -265,7 +265,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_WL_BUFFER as u32, + ffi::GBM_BO_IMPORT_WL_BUFFER, buffer.id().as_ptr() as *mut _, usage.bits(), ) @@ -298,7 +298,7 @@ impl Device { ) -> IoResult> { let ptr = ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_EGL_IMAGE as u32, + ffi::GBM_BO_IMPORT_EGL_IMAGE, buffer, usage.bits(), ); @@ -337,7 +337,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_FD as u32, + ffi::GBM_BO_IMPORT_FD, &mut fd_data as *mut ffi::gbm_import_fd_data as *mut _, usage.bits(), ) @@ -385,7 +385,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_FD_MODIFIER as u32, + ffi::GBM_BO_IMPORT_FD_MODIFIER, &mut fd_data as *mut ffi::gbm_import_fd_modifier_data as *mut _, usage.bits(), )