From a9467547aba4ae123964645a3553276fd7b9d3dd Mon Sep 17 00:00:00 2001 From: kelpsyberry <138107494+kelpsyberry@users.noreply.github.com> Date: Sat, 2 Nov 2024 18:25:38 +0100 Subject: [PATCH] Fix more warnings --- core/src/gpu/vram/bank_cnt.rs | 3 +-- core/src/lib.rs | 3 ++- frontend/desktop/src/input/map.rs | 2 +- frontend/desktop/src/utils.rs | 2 +- render/wgpu-3d/src/lib.rs | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/gpu/vram/bank_cnt.rs b/core/src/gpu/vram/bank_cnt.rs index c7d1575..648deae 100644 --- a/core/src/gpu/vram/bank_cnt.rs +++ b/core/src/gpu/vram/bank_cnt.rs @@ -425,8 +425,7 @@ impl Vram { (&mut *self.writeback.$usage.get()).fill(0); for (region, mapped) in self.map.$usage.iter().enumerate() { let mapped = mapped.get(); - let mask = if mapped != 0 - && mapped & (mapped - 1) == 0 + let mask = if mapped.is_power_of_two() && mapped & $mirrored_banks_mask == 0 && self.bg_obj_updates.is_none() { diff --git a/core/src/lib.rs b/core/src/lib.rs index f989976..c580539 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -31,7 +31,8 @@ clippy::must_use_candidate, clippy::missing_errors_doc, clippy::inline_always, - clippy::new_without_default + clippy::new_without_default, + clippy::manual_is_power_of_two )] pub extern crate emu_utils as utils; diff --git a/frontend/desktop/src/input/map.rs b/frontend/desktop/src/input/map.rs index 3bf2d3e..f69f26c 100644 --- a/frontend/desktop/src/input/map.rs +++ b/frontend/desktop/src/input/map.rs @@ -124,7 +124,7 @@ impl Serialize for Map { &'a HashMap, &'static [(T, &'static str)], ); - impl<'a, T: 'static + Eq, U: 'static + Serialize> Serialize for TriggerMap<'a, T, U> { + impl Serialize for TriggerMap<'_, T, U> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(Some(self.0.len()))?; for (key, value) in self.0 { diff --git a/frontend/desktop/src/utils.rs b/frontend/desktop/src/utils.rs index 0c4af30..bf1d4cb 100644 --- a/frontend/desktop/src/utils.rs +++ b/frontend/desktop/src/utils.rs @@ -111,7 +111,7 @@ static HOME: LazyLock> = struct HomePathBufVisitor; -impl<'de> serde::de::Visitor<'de> for HomePathBufVisitor { +impl serde::de::Visitor<'_> for HomePathBufVisitor { type Value = HomePathBuf; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/render/wgpu-3d/src/lib.rs b/render/wgpu-3d/src/lib.rs index aab4ca0..405ab97 100644 --- a/render/wgpu-3d/src/lib.rs +++ b/render/wgpu-3d/src/lib.rs @@ -1,5 +1,6 @@ #![feature(portable_simd, maybe_uninit_uninit_array, new_zeroed_alloc)] #![warn(clippy::all)] +#![allow(clippy::manual_div_ceil)] mod data; pub use data::{FogData, FrameData, GxData, RenderingData};