From e226155f2137d91dfed0a140ad9827e0c0b9499b Mon Sep 17 00:00:00 2001 From: Joe Clay <27cupsofcoffee@gmail.com> Date: Tue, 2 Jan 2024 20:02:27 +0000 Subject: [PATCH] Fix some Clippy lints --- src/graphics/scaling.rs | 4 ++-- src/platform/device_gl.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/scaling.rs b/src/graphics/scaling.rs index aea4b19d..92de0c0f 100644 --- a/src/graphics/scaling.rs +++ b/src/graphics/scaling.rs @@ -148,8 +148,8 @@ impl ScreenScaler { /// feasible (e.g. 3rd party UI libraries). pub fn scale_factor(&self) -> f32 { f32::min( - self.screen_rect.width as f32 / self.inner_width as f32, - self.screen_rect.height as f32 / self.inner_height as f32, + self.screen_rect.width / self.inner_width as f32, + self.screen_rect.height / self.inner_height as f32, ) } diff --git a/src/platform/device_gl.rs b/src/platform/device_gl.rs index ce66bf95..c145ec89 100644 --- a/src/platform/device_gl.rs +++ b/src/platform/device_gl.rs @@ -1555,7 +1555,7 @@ impl Drop for RawRenderbuffer { unsafe fn cast_slice_assume_aligned(a: &[A]) -> &[B] { slice::from_raw_parts( a.as_ptr() as *const B, - a.len() * mem::size_of::() / mem::size_of::(), + mem::size_of_val(a) / mem::size_of::(), ) }