From f4bc7f17bdcd738e1f64eb2dbad57590742fada4 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Thu, 3 Apr 2025 16:36:05 +0200 Subject: [PATCH] all: address clippy lints --- build/egl.rs | 2 +- src/gfx_apis/vulkan/renderer.rs | 2 +- src/ifs/ext_idle_notifier_v1.rs | 2 +- src/tasks/hardware_cursor.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/egl.rs b/build/egl.rs index d47388fb..93275263 100644 --- a/build/egl.rs +++ b/build/egl.rs @@ -158,7 +158,7 @@ fn write_egl_procs(f: &mut W) -> anyhow::Result<()> { writeln!(f, " unsafe {{")?; writeln!( f, - " ptr::read(&self.{} as *const *mut u8 as *const unsafe extern fn({}) -> {})({})", + r#" ptr::read(&self.{} as *const *mut u8 as *const unsafe extern "C" fn({}) -> {})({})"#, name, args_tys, ret, args_names )?; writeln!(f, " }}")?; diff --git a/src/gfx_apis/vulkan/renderer.rs b/src/gfx_apis/vulkan/renderer.rs index f3da7e78..1bf5f8d2 100644 --- a/src/gfx_apis/vulkan/renderer.rs +++ b/src/gfx_apis/vulkan/renderer.rs @@ -1507,7 +1507,7 @@ impl VulkanRenderer { }; match sync { AcquireSync::None => {} - AcquireSync::Implicit { .. } => { + AcquireSync::Implicit => { zone!("import implicit"); for plane in &buf.template.dmabuf.planes { let fd = dma_buf_export_sync_file(&plane.fd, flag) diff --git a/src/ifs/ext_idle_notifier_v1.rs b/src/ifs/ext_idle_notifier_v1.rs index ea2fdfa7..cdc79305 100644 --- a/src/ifs/ext_idle_notifier_v1.rs +++ b/src/ifs/ext_idle_notifier_v1.rs @@ -110,7 +110,7 @@ async fn run(n: Rc, skip_if_inhibited: bool) { .client .state .wheel - .timeout((n.duration_usec - elapsed + 999) / 1000) + .timeout((n.duration_usec - elapsed).div_ceil(1000)) .await; if let Err(e) = res { log::error!("Could not wait for idle timeout to elapse: {}", ErrorFmt(e)); diff --git a/src/tasks/hardware_cursor.rs b/src/tasks/hardware_cursor.rs index 6ebdbbb6..304b2ff7 100644 --- a/src/tasks/hardware_cursor.rs +++ b/src/tasks/hardware_cursor.rs @@ -14,7 +14,7 @@ pub async fn handle_hardware_cursor_tick(state: Rc) { continue; } loop { - let tick = (cursor.time_until_tick().as_nanos() + 999_999) / 1_000_000; + let tick = cursor.time_until_tick().as_nanos().div_ceil(1_000_000); if tick > 0 { let res = select! { _ = state.hardware_tick_cursor.non_empty().fuse() => break,