diff --git a/anvil/src/input_handler.rs b/anvil/src/input_handler.rs index 759d031073e5..94abef6346c9 100644 --- a/anvil/src/input_handler.rs +++ b/anvil/src/input_handler.rs @@ -66,6 +66,8 @@ use smithay::{ }; impl AnvilState { + // Allow in this method because of existing usage + #[allow(clippy::uninlined_format_args)] fn process_common_key_action(&mut self, action: KeyAction) { match action { KeyAction::None => (), diff --git a/anvil/src/main.rs b/anvil/src/main.rs index a962cf923442..725276611ab6 100644 --- a/anvil/src/main.rs +++ b/anvil/src/main.rs @@ -12,6 +12,8 @@ static POSSIBLE_BACKENDS: &[&str] = &[ static GLOBAL: profiling::tracy_client::ProfiledAllocator = profiling::tracy_client::ProfiledAllocator::new(std::alloc::System, 10); +// Allow in this function because of existing usage +#[allow(clippy::uninlined_format_args)] fn main() { if let Ok(env_filter) = tracing_subscriber::EnvFilter::try_from_default_env() { tracing_subscriber::fmt() diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index a33e0ba41038..049282eb310a 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -1,3 +1,5 @@ +// Allow in this module because of existing usage +#![allow(clippy::uninlined_format_args)] use std::{ collections::hash_map::HashMap, io, diff --git a/src/backend/egl/display.rs b/src/backend/egl/display.rs index f4e6637b7e3e..ed7442ef6800 100644 --- a/src/backend/egl/display.rs +++ b/src/backend/egl/display.rs @@ -1042,7 +1042,7 @@ impl EGLBufferReader { /// Try to receive [`EGLBuffer`] from a given [`WlBuffer`]. /// /// In case the buffer is not managed by EGL (but e.g. the [`wayland::shm` module](crate::wayland::shm)) - /// a [`BufferAccessError::NotManaged`](crate::backend::egl::BufferAccessError::NotManaged) is returned. + /// a [`BufferAccessError::NotManaged`] is returned. #[profiling::function] pub fn egl_buffer_contents( &self, diff --git a/src/backend/mod.rs b/src/backend/mod.rs index b827971995f9..35dddf12e9d1 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -1,3 +1,5 @@ +// Allow in this module because of existing usage +#![allow(clippy::uninlined_format_args)] //! Backend (rendering/input) helpers //! //! This module provides helpers for interaction with the operating system. diff --git a/src/input/keyboard/mod.rs b/src/input/keyboard/mod.rs index 1c00d0c2eead..b52c00605ad6 100644 --- a/src/input/keyboard/mod.rs +++ b/src/input/keyboard/mod.rs @@ -942,7 +942,7 @@ impl KeyboardHandle { /// [`FilterResult::Intercept`] a value can be passed to be returned by the whole function. /// This mechanism can be used to implement compositor-level key bindings for example. /// - /// The module [`keysyms`](crate::input::keyboard::keysyms) exposes definitions of all possible keysyms + /// The module [`keysyms`] exposes definitions of all possible keysyms /// to be compared against. This includes non-character keysyms, such as XF86 special keys. #[instrument(level = "trace", parent = &self.arc.span, skip(self, data, filter))] pub fn input( diff --git a/src/utils/serial.rs b/src/utils/serial.rs index 503f8fdfdf4b..a195b488d8d3 100644 --- a/src/utils/serial.rs +++ b/src/utils/serial.rs @@ -22,11 +22,7 @@ impl Eq for Serial {} impl PartialOrd for Serial { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - let distance = if self.0 > other.0 { - self.0 - other.0 - } else { - other.0 - self.0 - }; + let distance = self.0.abs_diff(other.0); if distance < u32::MAX / 2 { self.0.partial_cmp(&other.0) } else { diff --git a/src/wayland/mod.rs b/src/wayland/mod.rs index 70d0df354cd8..17c28a2f3573 100644 --- a/src/wayland/mod.rs +++ b/src/wayland/mod.rs @@ -1,3 +1,5 @@ +// Allow in this module because of existing usage +#![allow(clippy::uninlined_format_args)] //! Protocol-related utilities //! //! This module contains several handlers to manage the Wayland protocol diff --git a/src/wayland/selection/data_device/mod.rs b/src/wayland/selection/data_device/mod.rs index 4a7ff7413b64..ae7fa95e8aff 100644 --- a/src/wayland/selection/data_device/mod.rs +++ b/src/wayland/selection/data_device/mod.rs @@ -259,7 +259,7 @@ where /// You need to provide the available mime types for this selection. /// /// Whenever a client requests to read the selection, your callback will -/// receive a [`SelectionHandler::send_selection`](crate::wayland::selection::SelectionHandler::send_selection) event. +/// receive a [`SelectionHandler::send_selection`] event. #[instrument(name = "wayland_data_device", level = "debug", skip(dh, seat, user_data), fields(seat = seat.name()))] pub fn set_data_device_selection( dh: &DisplayHandle, diff --git a/src/xwayland/mod.rs b/src/xwayland/mod.rs index 56e054f7ff62..7173b676a2c6 100644 --- a/src/xwayland/mod.rs +++ b/src/xwayland/mod.rs @@ -1,3 +1,5 @@ +// Allow in this module because of existing usage +#![allow(clippy::uninlined_format_args)] //! XWayland utilities //! //! This module contains helpers to manage XWayland from your compositor, in order