refactor: pedantic cargo clippy, do not use Results for always-succeeding functions

This commit is contained in:
Aleksander
2025-08-16 21:27:47 +02:00
parent 1f8960033c
commit 481db7f23c
45 changed files with 320 additions and 310 deletions

View File

@@ -20,7 +20,8 @@ pub struct Viewport {
impl Viewport {
/// Creates a new `Viewport` with the given `device` and `cache`.
pub fn new(gfx: Arc<WGfx>) -> anyhow::Result<Self> {
#[allow(clippy::iter_on_single_items)]
pub fn new(gfx: &Arc<WGfx>) -> anyhow::Result<Self> {
let params = Params {
screen_resolution: [0, 0],
pixel_scale: 1.0,
@@ -87,7 +88,7 @@ impl Viewport {
}
/// Returns the current resolution of the `Viewport`.
pub fn resolution(&self) -> [u32; 2] {
pub const fn resolution(&self) -> [u32; 2] {
self.params.screen_resolution
}
}