From e377470f3f50900a9db8b4aa049a7c2cb0cb9ce4 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 6 Sep 2024 11:08:22 +0200 Subject: [PATCH] all: use expect attribute where possible --- algorithms/src/rect/region.rs | 2 +- build/enums.rs | 4 +- build/tokens.rs | 2 +- build/wire.rs | 4 +- build/wire_ei.rs | 4 +- build/wire_xcon.rs | 2 +- jay-config/src/macros.rs | 2 - src/acceptor.rs | 2 +- src/allocator.rs | 2 +- src/backend.rs | 4 +- src/backends/x.rs | 2 +- src/client.rs | 4 +- src/compositor.rs | 7 +++- src/cursor_user.rs | 2 +- src/damage.rs | 1 - src/dbus.rs | 18 ++++----- src/dbus/incoming.rs | 2 +- src/dbus/socket.rs | 2 +- src/dbus/types.rs | 2 +- src/edid.rs | 40 +++++++++---------- src/ei/ei_ifs/ei_device.rs | 4 +- src/ei/ei_ifs/ei_pingpong.rs | 2 +- src/ei/ei_object.rs | 2 +- src/format.rs | 2 +- src/gfx_apis/gl.rs | 8 ++-- src/gfx_apis/gl/egl/sys.rs | 1 - src/gfx_apis/gl/gl/sys.rs | 4 +- src/gfx_apis/vulkan/pipeline.rs | 2 +- src/globals.rs | 2 +- src/ifs/ipc/wl_data_device.rs | 2 +- src/ifs/ipc/wl_data_device_manager.rs | 6 +-- src/ifs/ipc/wl_data_offer.rs | 8 ++-- src/ifs/ipc/wl_data_source.rs | 4 +- src/ifs/org_kde_kwin_server_decoration.rs | 4 +- .../org_kde_kwin_server_decoration_manager.rs | 4 +- src/ifs/wl_buffer.rs | 3 +- src/ifs/wl_display.rs | 2 +- src/ifs/wl_output.rs | 12 +++--- src/ifs/wl_seat.rs | 2 +- src/ifs/wl_seat/pointer_owner.rs | 2 +- src/ifs/wl_seat/tablet.rs | 2 +- src/ifs/wl_seat/wl_keyboard.rs | 2 +- src/ifs/wl_seat/wl_pointer.rs | 3 +- src/ifs/wl_seat/wl_touch.rs | 8 ++-- src/ifs/wl_subcompositor.rs | 2 +- src/ifs/wl_surface.rs | 8 ++-- src/ifs/wl_surface/wl_subsurface.rs | 2 +- src/ifs/wl_surface/xdg_surface.rs | 4 +- src/ifs/wl_surface/xdg_surface/xdg_popup.rs | 2 +- .../wl_surface/xdg_surface/xdg_toplevel.rs | 12 +++--- src/ifs/wl_surface/zwlr_layer_surface_v1.rs | 1 - .../wl_surface/zwp_input_popup_surface_v2.rs | 2 +- src/ifs/wp_drm_lease_connector_v1.rs | 2 +- src/ifs/wp_presentation_feedback.rs | 4 +- src/ifs/xdg_wm_base.rs | 10 ++--- src/ifs/zwlr_screencopy_frame_v1.rs | 4 +- src/ifs/zwp_linux_buffer_params_v1.rs | 6 +-- src/ifs/zwp_linux_dmabuf_feedback_v1.rs | 1 - src/ifs/zxdg_output_v1.rs | 4 +- src/io_uring/ops/poll.rs | 2 +- src/io_uring/ops/timeout.rs | 1 - src/it/test_client.rs | 4 +- src/it/test_ifs/test_cursor_shape_device.rs | 2 +- src/it/test_ifs/test_cursor_shape_manager.rs | 2 +- src/it/test_ifs/test_data_control_device.rs | 4 +- src/it/test_ifs/test_data_device.rs | 1 - src/it/test_ifs/test_data_source.rs | 2 - src/it/test_ifs/test_dmabuf.rs | 2 +- .../test_ext_foreign_toplevel_list.rs | 2 +- src/it/test_ifs/test_input_method.rs | 2 +- src/it/test_ifs/test_shm.rs | 2 - src/it/test_ifs/test_shm_buffer.rs | 1 - src/it/test_ifs/test_shm_pool.rs | 3 +- src/it/test_ifs/test_subsurface.rs | 3 +- src/it/test_mem.rs | 3 -- src/it/test_object.rs | 2 +- src/it/test_utils/test_expected_event.rs | 1 - src/it/test_utils/test_surface_ext.rs | 1 - src/libinput/device.rs | 2 - src/libinput/event.rs | 1 - src/macros.rs | 29 +++++++------- src/main.rs | 1 + src/object.rs | 4 +- src/pipewire/pw_con.rs | 4 +- src/pipewire/pw_formatter.rs | 13 +++--- src/pipewire/pw_ifs/pw_client_node.rs | 6 +-- src/pipewire/pw_mem.rs | 9 ++--- src/portal.rs | 4 +- src/portal/ptr_gui.rs | 5 +-- src/rect.rs | 7 ++-- src/rect/region.rs | 4 +- src/state.rs | 1 - src/tasks/drmdev.rs | 1 - src/theme.rs | 11 +++-- src/tools/tool_client.rs | 2 +- src/tree.rs | 4 +- src/tree/container.rs | 3 +- src/udev.rs | 10 ++--- src/udmabuf.rs | 1 - src/utils/buffd/ei_formatter.rs | 2 +- src/utils/buffd/formatter.rs | 2 +- src/utils/buffd/parser.rs | 3 +- src/utils/clone3.rs | 2 +- src/utils/clonecell.rs | 1 - src/utils/linkedlist.rs | 3 +- src/utils/num_cpus.rs | 2 +- src/utils/oserror.rs | 2 +- src/utils/timer.rs | 2 +- src/utils/tri.rs | 2 +- src/utils/vecset.rs | 2 +- src/utils/vecstorage.rs | 1 - src/utils/windows.rs | 3 +- src/video.rs | 1 - src/video/dmabuf.rs | 2 - src/video/drm.rs | 9 ++--- src/video/drm/sync_obj.rs | 2 +- src/video/drm/sys.rs | 11 +++-- src/video/gbm.rs | 15 +++---- src/wl_usr/usr_ifs/usr_jay_compositor.rs | 2 +- src/wl_usr/usr_ifs/usr_jay_screencast.rs | 2 +- src/wl_usr/usr_ifs/usr_wl_pointer.rs | 2 +- src/wl_usr/usr_ifs/usr_wl_shm.rs | 2 +- src/wl_usr/usr_ifs/usr_wl_shm_pool.rs | 2 +- src/wl_usr/usr_ifs/usr_wlr_layer_surface.rs | 4 +- src/wl_usr/usr_ifs/usr_wp_viewport.rs | 2 +- .../usr_ifs/usr_zwlr_screencopy_frame.rs | 4 +- .../usr_ifs/usr_zwlr_screencopy_manager.rs | 2 +- src/xcon/incoming.rs | 2 +- src/xkbcommon.rs | 5 +-- src/xwayland.rs | 2 +- src/xwayland/xwm.rs | 4 +- toml-config/src/config/extractor.rs | 6 +-- toml-config/src/config/parser.rs | 2 +- toml-config/src/toml/toml_parser.rs | 2 +- 134 files changed, 241 insertions(+), 296 deletions(-) diff --git a/algorithms/src/rect/region.rs b/algorithms/src/rect/region.rs index f4afdaa5..6cb8fa1c 100644 --- a/algorithms/src/rect/region.rs +++ b/algorithms/src/rect/region.rs @@ -393,7 +393,7 @@ pub fn rects_to_bands(rects_tmp: &[RectRaw]) -> Container { let mut res = Container::new(); for &[y1, y2] in ys.array_windows_ext::<2>() { - #[allow(clippy::never_loop)] + #[expect(clippy::never_loop)] loop { macro_rules! check_rect { ($rect:expr) => {{ diff --git a/build/enums.rs b/build/enums.rs index d7316e50..7f904a7d 100644 --- a/build/enums.rs +++ b/build/enums.rs @@ -4,7 +4,7 @@ use { std::{env, io::Write}, }; -#[allow(unused_macros)] +#[expect(unused_macros)] #[macro_use] #[path = "../src/macros.rs"] mod macros; @@ -43,7 +43,7 @@ fn get_enum_ty(variants: Vec) -> anyhow::Result { fn write_ty(f: &mut W, vals: &[i32], ty: &str) -> anyhow::Result<()> { let variants: Vec<_> = vals.iter().cloned().map(|v| v as i128).collect(); let size = get_enum_ty(variants)?; - writeln!(f, "#[allow(dead_code)]")?; + writeln!(f, "#[allow(clippy::allow_attributes, dead_code)]")?; writeln!(f, "pub type {} = i{};", ty, size)?; Ok(()) } diff --git a/build/tokens.rs b/build/tokens.rs index 67be37fc..be3bcde2 100644 --- a/build/tokens.rs +++ b/build/tokens.rs @@ -241,7 +241,7 @@ impl<'a> Tokenizer<'a> { #[derive(Debug)] pub struct Lined { - #[allow(dead_code)] + #[expect(dead_code)] pub line: u32, pub val: T, } diff --git a/build/wire.rs b/build/wire.rs index 330d2500..31137918 100644 --- a/build/wire.rs +++ b/build/wire.rs @@ -201,7 +201,7 @@ impl<'a> Tokenizer<'a> { #[derive(Debug)] struct Lined { - #[allow(dead_code)] + #[expect(dead_code)] line: u32, val: T, } @@ -755,7 +755,7 @@ fn write_request_handler( parser = "crate::wl_usr::UsrCon"; error = "crate::wl_usr::UsrConError"; param = "ev"; - writeln!(f, " #[allow(dead_code)]")?; + writeln!(f, " #[allow(clippy::allow_attributes, dead_code)]")?; } } writeln!( diff --git a/build/wire_ei.rs b/build/wire_ei.rs index 9f77a95f..388d214b 100644 --- a/build/wire_ei.rs +++ b/build/wire_ei.rs @@ -9,7 +9,7 @@ use { #[derive(Debug)] struct Lined { - #[allow(dead_code)] + #[expect(dead_code)] line: u32, val: T, } @@ -637,7 +637,7 @@ fn write_interface_versions(f: &mut W, obj_names: &[String]) -> Result writeln!(f, " }}")?; for obj_name in obj_names { writeln!(f)?; - writeln!(f, " #[allow(dead_code)]")?; + writeln!(f, " #[allow(clippy::allow_attributes, dead_code)]")?; writeln!(f, " pub fn {obj_name}(&self) -> EiVersion {{")?; writeln!(f, " self.{obj_name}.version.get()")?; writeln!(f, " }}")?; diff --git a/build/wire_xcon.rs b/build/wire_xcon.rs index fa180efe..58a2c71c 100644 --- a/build/wire_xcon.rs +++ b/build/wire_xcon.rs @@ -813,7 +813,7 @@ struct Extension { #[derive(Debug)] enum NamedType { Struct(Rc), - Bitmask(#[allow(dead_code)] Rc), + Bitmask(#[expect(dead_code)] Rc), Enum(Rc), } diff --git a/jay-config/src/macros.rs b/jay-config/src/macros.rs index d470b6f2..47d60527 100644 --- a/jay-config/src/macros.rs +++ b/jay-config/src/macros.rs @@ -18,7 +18,6 @@ macro_rules! config { macro_rules! try_get { () => {{ - #[allow(unused_unsafe)] unsafe { let client = crate::_private::client::CLIENT.with(|client| client.get()); if client.is_null() { @@ -35,7 +34,6 @@ macro_rules! get { get!(Default::default()) }}; ($def:expr) => {{ - #[allow(unused_unsafe)] let client = unsafe { let client = crate::_private::client::CLIENT.with(|client| client.get()); if client.is_null() { diff --git a/src/acceptor.rs b/src/acceptor.rs index 5f5ce8ff..4fa6f13d 100644 --- a/src/acceptor.rs +++ b/src/acceptor.rs @@ -165,7 +165,7 @@ impl Acceptor { &self.socket.name } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn secure_path(&self) -> &Ustr { self.socket.secure_path.as_ustr() } diff --git a/src/allocator.rs b/src/allocator.rs index e71d86dc..6354bdb7 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -51,7 +51,7 @@ pub trait BufferObject { pub trait MappedBuffer { unsafe fn data(&self) -> &[u8]; - #[cfg_attr(not(test), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] fn data_ptr(&self) -> *mut u8; fn stride(&self) -> i32; } diff --git a/src/backend.rs b/src/backend.rs index ffeedc5a..81c69213 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -38,7 +38,7 @@ pub trait Backend { fn clear(&self) { // nothing } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] fn into_any(self: Rc) -> Rc; fn switch_to(&self, vtnr: u32) { @@ -430,7 +430,7 @@ pub enum InputEvent { } pub enum DrmEvent { - #[allow(dead_code)] + #[expect(dead_code)] Removed, GfxApiChanged, } diff --git a/src/backends/x.rs b/src/backends/x.rs index 0b80f5c7..c66a46eb 100644 --- a/src/backends/x.rs +++ b/src/backends/x.rs @@ -944,7 +944,7 @@ impl XBackend { if changed { let images = self.create_images(output.window, width, height).await?; for (new, old) in images.iter().zip(output.images.iter()) { - #[allow(clippy::let_underscore_future)] + #[expect(clippy::let_underscore_future)] let _ = self.c.call(&FreePixmap { pixmap: old.pixmap.get(), }); diff --git a/src/client.rs b/src/client.rs index 19ba92cc..f13fff45 100644 --- a/src/client.rs +++ b/src/client.rs @@ -69,7 +69,6 @@ impl ClientId { self.0 } - #[cfg_attr(not(feature = "it"), allow(dead_code))] pub fn from_raw(val: u64) -> Self { Self(val) } @@ -105,7 +104,7 @@ impl Clients { ClientId(self.next_client_id.fetch_add(1)) } - #[allow(dead_code)] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn get(&self, id: ClientId) -> Result, ClientError> { let clients = self.clients.borrow(); match clients.get(&id) { @@ -443,7 +442,6 @@ impl Client { self.add_obj(obj, true) } - #[allow(dead_code)] pub fn add_server_obj(&self, obj: &Rc) { self.add_obj(obj, false).expect("add_server_obj failed") } diff --git a/src/compositor.rs b/src/compositor.rs index 7bfd478a..ad5d5720 100644 --- a/src/compositor.rs +++ b/src/compositor.rs @@ -324,7 +324,10 @@ async fn start_compositor3(state: Rc, test_future: Option) { state.ring.stop(); } -fn load_config(state: &Rc, #[allow(unused_variables)] for_test: bool) -> ConfigProxy { +fn load_config( + state: &Rc, + #[allow(clippy::allow_attributes, unused_variables)] for_test: bool, +) -> ConfigProxy { #[cfg(feature = "it")] if for_test { return ConfigProxy::for_test(state); @@ -365,7 +368,7 @@ fn start_global_event_handlers( async fn create_backend( state: &Rc, - #[allow(unused_variables)] test_future: Option, + #[allow(clippy::allow_attributes, unused_variables)] test_future: Option, ) -> Option> { #[cfg(feature = "it")] if let Some(tf) = test_future { diff --git a/src/cursor_user.rs b/src/cursor_user.rs index deb37bd5..46e407b8 100644 --- a/src/cursor_user.rs +++ b/src/cursor_user.rs @@ -265,7 +265,7 @@ impl CursorUser { } } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn desired_known_cursor(&self) -> Option { self.desired_known_cursor.get() } diff --git a/src/damage.rs b/src/damage.rs index 9439a739..9523415a 100644 --- a/src/damage.rs +++ b/src/damage.rs @@ -89,7 +89,6 @@ impl DamageVisualizer { } } - #[allow(dead_code)] pub fn add(&self, rect: Rect) { if !self.enabled.get() { return; diff --git a/src/dbus.rs b/src/dbus.rs index f1f88f6e..4c8037ff 100644 --- a/src/dbus.rs +++ b/src/dbus.rs @@ -274,23 +274,23 @@ const MSG_ERROR: u8 = 3; const MSG_SIGNAL: u8 = 4; const NO_REPLY_EXPECTED: u8 = 0x1; -#[allow(dead_code)] +#[expect(dead_code)] const NO_AUTO_START: u8 = 0x2; -#[allow(dead_code)] +#[expect(dead_code)] const ALLOW_INTERACTIVE_AUTHORIZATION: u8 = 0x4; -#[allow(dead_code)] +#[expect(dead_code)] pub const DBUS_NAME_FLAG_ALLOW_REPLACEMENT: u32 = 0x1; -#[allow(dead_code)] +#[expect(dead_code)] pub const DBUS_NAME_FLAG_REPLACE_EXISTING: u32 = 0x2; pub const DBUS_NAME_FLAG_DO_NOT_QUEUE: u32 = 0x4; pub const DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] pub const DBUS_REQUEST_NAME_REPLY_IN_QUEUE: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] pub const DBUS_REQUEST_NAME_REPLY_EXISTS: u32 = 3; -#[allow(dead_code)] +#[expect(dead_code)] pub const DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER: u32 = 4; pub const BUS_DEST: &str = "org.freedesktop.DBus"; @@ -698,7 +698,7 @@ pub struct PendingReply { } impl PendingReply { - #[allow(dead_code)] + #[expect(dead_code)] pub fn reply_expected(&self) -> bool { self.reply_expected } @@ -720,7 +720,7 @@ where } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn complete<'a>(&self, res: Result<&T::Generic<'a>, &str>) { match res { Ok(m) => self.ok(m), diff --git a/src/dbus/incoming.rs b/src/dbus/incoming.rs index d511ed36..fa813779 100644 --- a/src/dbus/incoming.rs +++ b/src/dbus/incoming.rs @@ -77,7 +77,7 @@ impl Incoming { self.incoming .fill_msg_buf(remaining as usize, msg_buf) .await?; - #[allow(dropping_references)] + #[expect(dropping_references)] drop(msg_buf); let msg_buf = unsafe { msg_buf_data.get().deref().deref() }; let headers = &msg_buf[FIXED_HEADER_SIZE..FIXED_HEADER_SIZE + headers_len as usize]; diff --git a/src/dbus/socket.rs b/src/dbus/socket.rs index 2867d3d1..58242328 100644 --- a/src/dbus/socket.rs +++ b/src/dbus/socket.rs @@ -102,7 +102,7 @@ impl DbusSocket { } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn get(&self, destination: &str, path: &str, f: F) where T: Property, diff --git a/src/dbus/types.rs b/src/dbus/types.rs index ed043e13..ee811e21 100644 --- a/src/dbus/types.rs +++ b/src/dbus/types.rs @@ -354,7 +354,7 @@ unsafe impl<'a, K: DbusType<'a>, V: DbusType<'a>> DbusType<'a> for DictEntry { - #[allow(non_snake_case)] + #[expect(non_snake_case)] unsafe impl<'a, $($p: DbusType<'a>),*> DbusType<'a> for ($($p,)*) { const ALIGNMENT: usize = 8; const IS_POD: bool = false; diff --git a/src/edid.rs b/src/edid.rs index de8ecefe..61108d6f 100644 --- a/src/edid.rs +++ b/src/edid.rs @@ -30,7 +30,7 @@ pub enum DigitalVideoInterfaceStandard { HdmiB, MDDI, DisplayPort, - #[allow(dead_code)] + #[expect(dead_code)] Unknown(u8), } @@ -50,7 +50,7 @@ impl Debug for SignalLevelStandard { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub enum VideoInputDefinition { Analog { signal_level_standard: SignalLevelStandard, @@ -75,7 +75,7 @@ pub struct ScreenDimensions { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct ChromaticityCoordinates { pub red_x: u16, pub red_y: u16, @@ -88,7 +88,7 @@ pub struct ChromaticityCoordinates { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct EstablishedTimings { pub s_720x400_70: bool, pub s_720x400_88: bool, @@ -119,7 +119,7 @@ pub enum AspectRatio { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct StandardTiming { pub x_resolution: u16, pub aspect_ratio: AspectRatio, @@ -133,7 +133,7 @@ pub enum AnalogSyncType { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub enum SyncSignal { Analog { ty: AnalogSyncType, @@ -185,7 +185,7 @@ impl Debug for StereoViewingSupport { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct DisplayRangeLimitsAndAdditionalTiming { pub vertical_field_rate_min: u16, pub vertical_field_rate_max: u16, @@ -202,12 +202,12 @@ pub enum AspectRatioPreference { A16_10, A5_4, A15_9, - #[allow(dead_code)] + #[expect(dead_code)] Unknown(u8), } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub enum ExtendedTimingInformation { DefaultGtf, NoTimingInformation, @@ -241,7 +241,7 @@ pub enum ExtendedTimingInformation { } #[derive(Copy, Clone, Debug, Default)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct ColorPoint { pub white_point_index: u8, pub white_point_x: u16, @@ -250,7 +250,7 @@ pub struct ColorPoint { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct EstablishedTimings3 { pub s640x350_85: bool, pub s640x400_85: bool, @@ -299,7 +299,7 @@ pub struct EstablishedTimings3 { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct ColorManagementData { pub red_a3: u16, pub red_a2: u16, @@ -326,7 +326,7 @@ pub enum CvtPreferredVerticalRate { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct Cvt3ByteCode { pub addressable_lines_per_field: u16, pub aspect_ration: CvtAspectRatio, @@ -339,7 +339,7 @@ pub struct Cvt3ByteCode { } #[derive(Copy, Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct DetailedTimingDescriptor { pub pixel_clock_khz: u32, pub horizontal_addressable_pixels: u16, @@ -360,7 +360,7 @@ pub struct DetailedTimingDescriptor { } #[derive(Clone, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub enum Descriptor { Unknown(u8), DetailedTimingDescriptor(DetailedTimingDescriptor), @@ -394,7 +394,7 @@ macro_rules! bail { #[derive(Clone, Debug)] pub enum EdidParseContext { - #[allow(dead_code)] + #[expect(dead_code)] ReadingBytes(usize), BaseBlock, Descriptors, @@ -1031,7 +1031,7 @@ pub enum DisplayColorType { } #[derive(Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub enum FeatureSupport2 { Analog { display_color_type: DisplayColorType, @@ -1044,7 +1044,7 @@ pub enum FeatureSupport2 { } #[derive(Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct FeatureSupport { pub standby_supported: bool, pub suspend_supported: bool, @@ -1056,7 +1056,7 @@ pub struct FeatureSupport { } #[derive(Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct EdidBaseBlock { pub id_manufacturer_name: BString, pub id_product_code: u16, @@ -1083,7 +1083,7 @@ pub enum EdidExtension { } #[derive(Debug)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct EdidFile { pub base_block: EdidBaseBlock, pub extension_blocks: Vec, diff --git a/src/ei/ei_ifs/ei_device.rs b/src/ei/ei_ifs/ei_device.rs index f49fa97f..7f87fbae 100644 --- a/src/ei/ei_ifs/ei_device.rs +++ b/src/ei/ei_ifs/ei_device.rs @@ -26,7 +26,7 @@ use { }; pub const EI_DEVICE_TYPE_VIRTUAL: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] pub const EI_DEVICE_TYPE_PHYSICAL: u32 = 2; pub struct EiDevice { @@ -100,7 +100,7 @@ impl EiDevice { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_paused(&self, serial: u32) { self.client.event(Paused { self_id: self.id, diff --git a/src/ei/ei_ifs/ei_pingpong.rs b/src/ei/ei_ifs/ei_pingpong.rs index 53220676..5c132420 100644 --- a/src/ei/ei_ifs/ei_pingpong.rs +++ b/src/ei/ei_ifs/ei_pingpong.rs @@ -14,7 +14,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] pub struct EiPingpong { pub id: EiPingpongId, pub client: Rc, diff --git a/src/ei/ei_object.rs b/src/ei/ei_object.rs index 9aac90bd..57c860a0 100644 --- a/src/ei/ei_object.rs +++ b/src/ei/ei_object.rs @@ -20,7 +20,7 @@ pub const EI_HANDSHAKE_ID: EiHandshakeId = EiHandshakeId::from_raw(0); pub struct EiObjectId(u64); impl EiObjectId { - #[allow(dead_code)] + #[expect(dead_code)] pub const NONE: Self = EiObjectId(0); pub fn from_raw(raw: u64) -> Self { diff --git a/src/format.rs b/src/format.rs index 059a251e..392378a3 100644 --- a/src/format.rs +++ b/src/format.rs @@ -131,7 +131,7 @@ const fn fourcc_code(a: char, b: char, c: char, d: char) -> u32 { (a as u32) | ((b as u32) << 8) | ((c as u32) << 16) | ((d as u32) << 24) } -#[allow(dead_code)] +#[expect(dead_code)] pub fn debug(fourcc: u32) -> impl Debug { debug_fn(move |fmt| { fmt.write_char(fourcc as u8 as char)?; diff --git a/src/gfx_apis/gl.rs b/src/gfx_apis/gl.rs index 0fd8ed71..d8b96c05 100644 --- a/src/gfx_apis/gl.rs +++ b/src/gfx_apis/gl.rs @@ -5,12 +5,12 @@ macro_rules! egl_transparent { pub struct $name(pub *mut u8); impl $name { - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub const fn none() -> Self { Self(std::ptr::null_mut()) } - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub fn is_none(self) -> bool { self.0.is_null() } @@ -26,7 +26,7 @@ macro_rules! dynload { )* } ) => { - #[allow(non_snake_case)] + #[expect(non_snake_case)] #[derive(Debug)] pub struct $container { _lib: libloading::Library, @@ -45,7 +45,7 @@ macro_rules! dynload { } }; $( - #[allow(non_snake_case)] + #[expect(non_snake_case)] let $fun: $ty = match lib.get(stringify!($fun).as_bytes()) { Ok(s) => *s, diff --git a/src/gfx_apis/gl/egl/sys.rs b/src/gfx_apis/gl/egl/sys.rs index 0b4493e3..8c9a086a 100644 --- a/src/gfx_apis/gl/egl/sys.rs +++ b/src/gfx_apis/gl/egl/sys.rs @@ -3,7 +3,6 @@ use {crate::gfx_apis::gl::sys::GLenum, uapi::c}; pub type EGLint = i32; pub type EGLenum = c::c_uint; pub type EGLBoolean = c::c_uint; -#[allow(dead_code)] pub type EGLuint64KHR = u64; pub type EGLAttrib = isize; pub type EGLSyncKHR = *mut u8; diff --git a/src/gfx_apis/gl/gl/sys.rs b/src/gfx_apis/gl/gl/sys.rs index a69fbf7a..f36650e4 100644 --- a/src/gfx_apis/gl/gl/sys.rs +++ b/src/gfx_apis/gl/gl/sys.rs @@ -7,7 +7,7 @@ pub type GLenum = c::c_uint; pub type GLfloat = f32; pub type GLint = c::c_int; pub type GLsizei = c::c_int; -#[allow(dead_code)] +#[expect(dead_code)] pub type GLubyte = u8; pub type GLuint = c::c_uint; @@ -32,7 +32,7 @@ pub const GL_RENDERBUFFER: GLenum = 0x8D41; pub const GL_TEXTURE0: GLenum = 0x84C0; pub const GL_TEXTURE_2D: GLenum = 0x0DE1; pub const GL_TEXTURE_EXTERNAL_OES: GLenum = 0x8D65; -#[allow(dead_code)] +#[expect(dead_code)] pub const GL_TEXTURE_MAG_FILTER: GLenum = 0x2800; pub const GL_TEXTURE_MIN_FILTER: GLenum = 0x2801; pub const GL_TEXTURE_WRAP_S: GLenum = 0x2802; diff --git a/src/gfx_apis/vulkan/pipeline.rs b/src/gfx_apis/vulkan/pipeline.rs index 17845186..037e1692 100644 --- a/src/gfx_apis/vulkan/pipeline.rs +++ b/src/gfx_apis/vulkan/pipeline.rs @@ -70,7 +70,7 @@ impl VulkanDevice { .offset(push_constant_offset) .size(frag_push_size), ); - #[allow(unused_assignments)] + #[expect(unused_assignments)] { push_constant_offset += frag_push_size; } diff --git a/src/globals.rs b/src/globals.rs index 73a92f1f..c8595388 100644 --- a/src/globals.rs +++ b/src/globals.rs @@ -321,7 +321,7 @@ impl Globals { } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn get_output(&self, output: GlobalName) -> Result, GlobalsError> { match self.outputs.get(&output) { Some(o) => Ok(o), diff --git a/src/ifs/ipc/wl_data_device.rs b/src/ifs/ipc/wl_data_device.rs index 9bcd22c0..cf4b55ec 100644 --- a/src/ifs/ipc/wl_data_device.rs +++ b/src/ifs/ipc/wl_data_device.rs @@ -19,7 +19,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const ROLE: u32 = 0; pub struct WlDataDevice { diff --git a/src/ifs/ipc/wl_data_device_manager.rs b/src/ifs/ipc/wl_data_device_manager.rs index 73b6c199..840e2546 100644 --- a/src/ifs/ipc/wl_data_device_manager.rs +++ b/src/ifs/ipc/wl_data_device_manager.rs @@ -12,11 +12,11 @@ use { }; pub(super) const DND_NONE: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] pub(super) const DND_COPY: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] pub(super) const DND_MOVE: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] pub(super) const DND_ASK: u32 = 4; pub(super) const DND_ALL: u32 = 7; diff --git a/src/ifs/ipc/wl_data_offer.rs b/src/ifs/ipc/wl_data_offer.rs index 333b6a7a..c2db7aba 100644 --- a/src/ifs/ipc/wl_data_offer.rs +++ b/src/ifs/ipc/wl_data_offer.rs @@ -21,13 +21,13 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_FINISH: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_ACTION_MASK: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_ACTION: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_OFFER: u32 = 3; pub struct WlDataOffer { diff --git a/src/ifs/ipc/wl_data_source.rs b/src/ifs/ipc/wl_data_source.rs index 3aefe5fa..ad365eea 100644 --- a/src/ifs/ipc/wl_data_source.rs +++ b/src/ifs/ipc/wl_data_source.rs @@ -27,9 +27,9 @@ use { uapi::OwnedFd, }; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_ACTION_MASK: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_SOURCE: u32 = 1; pub struct WlDataSource { diff --git a/src/ifs/org_kde_kwin_server_decoration.rs b/src/ifs/org_kde_kwin_server_decoration.rs index 1b5ce1c5..cb5459c8 100644 --- a/src/ifs/org_kde_kwin_server_decoration.rs +++ b/src/ifs/org_kde_kwin_server_decoration.rs @@ -9,9 +9,9 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const NONE: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const CLIENT: u32 = 1; const SERVER: u32 = 2; diff --git a/src/ifs/org_kde_kwin_server_decoration_manager.rs b/src/ifs/org_kde_kwin_server_decoration_manager.rs index f4eb9a0b..733bd95f 100644 --- a/src/ifs/org_kde_kwin_server_decoration_manager.rs +++ b/src/ifs/org_kde_kwin_server_decoration_manager.rs @@ -13,9 +13,9 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const NONE: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const CLIENT: u32 = 1; const SERVER: u32 = 2; diff --git a/src/ifs/wl_buffer.rs b/src/ifs/wl_buffer.rs index 8f14f092..ffe03415 100644 --- a/src/ifs/wl_buffer.rs +++ b/src/ifs/wl_buffer.rs @@ -52,7 +52,6 @@ impl WlBuffer { self.destroyed.get() } - #[allow(clippy::too_many_arguments)] pub fn new_dmabuf( id: WlBufferId, client: &Rc, @@ -82,7 +81,7 @@ impl WlBuffer { } } - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new_shm( id: WlBufferId, client: &Rc, diff --git a/src/ifs/wl_display.rs b/src/ifs/wl_display.rs index d71ddf0b..83cc70a3 100644 --- a/src/ifs/wl_display.rs +++ b/src/ifs/wl_display.rs @@ -12,7 +12,7 @@ use { const INVALID_OBJECT: u32 = 0; const INVALID_METHOD: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const NO_MEMORY: u32 = 2; const IMPLEMENTATION: u32 = 3; diff --git a/src/ifs/wl_output.rs b/src/ifs/wl_output.rs index 0b9f549c..e274f43b 100644 --- a/src/ifs/wl_output.rs +++ b/src/ifs/wl_output.rs @@ -26,15 +26,15 @@ use { }; const SP_UNKNOWN: i32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const SP_NONE: i32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const SP_HORIZONTAL_RGB: i32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const SP_HORIZONTAL_BGR: i32 = 3; -#[allow(dead_code)] +#[expect(dead_code)] const SP_VERTICAL_RGB: i32 = 4; -#[allow(dead_code)] +#[expect(dead_code)] const SP_VERTICAL_BGR: i32 = 5; pub const TF_NORMAL: i32 = 0; @@ -47,7 +47,7 @@ pub const TF_FLIPPED_180: i32 = 6; pub const TF_FLIPPED_270: i32 = 7; const MODE_CURRENT: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const MODE_PREFERRED: u32 = 2; pub struct WlOutputGlobal { diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index 48d2190d..45e7e4b9 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -109,7 +109,7 @@ pub const POINTER: u32 = 1; const KEYBOARD: u32 = 2; const TOUCH: u32 = 4; -#[allow(dead_code)] +#[expect(dead_code)] const MISSING_CAPABILITY: u32 = 0; pub const BTN_LEFT: u32 = 0x110; diff --git a/src/ifs/wl_seat/pointer_owner.rs b/src/ifs/wl_seat/pointer_owner.rs index 527ae609..5f3623c7 100644 --- a/src/ifs/wl_seat/pointer_owner.rs +++ b/src/ifs/wl_seat/pointer_owner.rs @@ -714,7 +714,7 @@ trait NodeSelectorUsecase: Sized + 'static { fn node_focus(self: &Rc, seat: &Rc, node: &Rc); } -impl SimplePointerOwnerUsecase for Rc { +impl SimplePointerOwnerUsecase for Rc { const FIND_TREE_USECASE: FindTreeUsecase = ::FIND_TREE_USECASE; const IS_DEFAULT: bool = false; diff --git a/src/ifs/wl_seat/tablet.rs b/src/ifs/wl_seat/tablet.rs index 95f28408..4aa9db6d 100644 --- a/src/ifs/wl_seat/tablet.rs +++ b/src/ifs/wl_seat/tablet.rs @@ -127,7 +127,7 @@ pub enum TabletToolType { Brush, Pencil, Airbrush, - #[allow(dead_code)] + #[expect(dead_code)] Finger, Mouse, Lens, diff --git a/src/ifs/wl_seat/wl_keyboard.rs b/src/ifs/wl_seat/wl_keyboard.rs index bce6aca6..45120a92 100644 --- a/src/ifs/wl_seat/wl_keyboard.rs +++ b/src/ifs/wl_seat/wl_keyboard.rs @@ -14,7 +14,7 @@ use { pub const REPEAT_INFO_SINCE: Version = Version(4); -#[allow(dead_code)] +#[expect(dead_code)] const NO_KEYMAP: u32 = 0; pub const XKB_V1: u32 = 1; diff --git a/src/ifs/wl_seat/wl_pointer.rs b/src/ifs/wl_seat/wl_pointer.rs index fa1f71f8..d5b00890 100644 --- a/src/ifs/wl_seat/wl_pointer.rs +++ b/src/ifs/wl_seat/wl_pointer.rs @@ -12,7 +12,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const ROLE: u32 = 0; pub(super) const RELEASED: u32 = 0; @@ -24,7 +24,6 @@ pub const HORIZONTAL_SCROLL: u32 = 1; pub const WHEEL: u32 = 0; pub const FINGER: u32 = 1; pub const CONTINUOUS: u32 = 2; -#[allow(dead_code)] pub const WHEEL_TILT: u32 = 3; pub const IDENTICAL: u32 = 0; diff --git a/src/ifs/wl_seat/wl_touch.rs b/src/ifs/wl_seat/wl_touch.rs index 384f4543..3672c740 100644 --- a/src/ifs/wl_seat/wl_touch.rs +++ b/src/ifs/wl_seat/wl_touch.rs @@ -11,9 +11,9 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] pub const SHAPE_SINCE_VERSION: Version = Version(6); -#[allow(dead_code)] +#[expect(dead_code)] pub const ORIENTATION_DIRECTION_SINCE_VERSION: Version = Version(6); pub struct WlTouch { @@ -78,7 +78,7 @@ impl WlTouch { self.seat.client.event(Cancel { self_id: self.id }) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_shape(&self, id: i32, major: Fixed, minor: Fixed) { self.seat.client.event(Shape { self_id: self.id, @@ -88,7 +88,7 @@ impl WlTouch { }) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_orientation(&self, id: i32, orientation: Fixed) { self.seat.client.event(Orientation { self_id: self.id, diff --git a/src/ifs/wl_subcompositor.rs b/src/ifs/wl_subcompositor.rs index bc3ea8af..91ca485a 100644 --- a/src/ifs/wl_subcompositor.rs +++ b/src/ifs/wl_subcompositor.rs @@ -11,7 +11,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const BAD_SURFACE: u32 = 0; pub struct WlSubcompositorGlobal { diff --git a/src/ifs/wl_surface.rs b/src/ifs/wl_surface.rs index 8fcbb2f4..d04b82b2 100644 --- a/src/ifs/wl_surface.rs +++ b/src/ifs/wl_surface.rs @@ -96,11 +96,11 @@ use { zwp_idle_inhibitor_v1::ZwpIdleInhibitorV1, }; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_SCALE: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_TRANSFORM: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_SIZE: u32 = 2; const OFFSET_SINCE: Version = Version(5); @@ -634,7 +634,7 @@ impl WlSurface { Ok(ext.into_xsurface().unwrap()) } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn get_output(&self) -> Rc { self.output.get() } diff --git a/src/ifs/wl_surface/wl_subsurface.rs b/src/ifs/wl_surface/wl_subsurface.rs index 68edb39a..e72a2b01 100644 --- a/src/ifs/wl_surface/wl_subsurface.rs +++ b/src/ifs/wl_surface/wl_subsurface.rs @@ -24,7 +24,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const BAD_SURFACE: u32 = 0; const MAX_SUBSURFACE_DEPTH: u32 = 100; diff --git a/src/ifs/wl_surface/xdg_surface.rs b/src/ifs/wl_surface/xdg_surface.rs index 3cf3d575..5a23c9fa 100644 --- a/src/ifs/wl_surface/xdg_surface.rs +++ b/src/ifs/wl_surface/xdg_surface.rs @@ -37,10 +37,10 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const NOT_CONSTRUCTED: u32 = 1; const ALREADY_CONSTRUCTED: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const UNCONFIGURED_BUFFER: u32 = 3; #[derive(Copy, Clone, Debug, Eq, PartialEq)] diff --git a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs index cf25578a..7351dde9 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs @@ -30,7 +30,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_GRAB: u32 = 1; tree_id!(PopupId); diff --git a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs index 403c3bd5..426f8b6d 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs @@ -56,10 +56,10 @@ pub enum ResizeEdge { BottomRight = 10, } -#[allow(dead_code)] +#[expect(dead_code)] const STATE_MAXIMIZED: u32 = 1; const STATE_FULLSCREEN: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const STATE_RESIZING: u32 = 3; const STATE_ACTIVATED: u32 = 4; const STATE_TILED_LEFT: u32 = 5; @@ -68,12 +68,12 @@ const STATE_TILED_TOP: u32 = 7; const STATE_TILED_BOTTOM: u32 = 8; pub const STATE_SUSPENDED: u32 = 9; -#[allow(dead_code)] +#[expect(dead_code)] const CAP_WINDOW_MENU: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const CAP_MAXIMIZE: u32 = 2; const CAP_FULLSCREEN: u32 = 3; -#[allow(dead_code)] +#[expect(dead_code)] const CAP_MINIMIZE: u32 = 4; pub const WM_CAPABILITIES_SINCE: Version = Version(5); @@ -81,7 +81,7 @@ pub const SUSPENDED_SINCE: Version = Version(6); #[derive(Copy, Clone, Eq, PartialEq, Debug)] pub enum Decoration { - #[allow(dead_code)] + #[expect(dead_code)] Client, Server, } diff --git a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs index f232f532..d7996a08 100644 --- a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs +++ b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs @@ -37,7 +37,6 @@ use { }; const KI_NONE: u32 = 0; -#[allow(dead_code)] const KI_EXCLUSIVE: u32 = 1; const KI_ON_DEMAND: u32 = 2; diff --git a/src/ifs/wl_surface/zwp_input_popup_surface_v2.rs b/src/ifs/wl_surface/zwp_input_popup_surface_v2.rs index 9f326e35..5cdc5eba 100644 --- a/src/ifs/wl_surface/zwp_input_popup_surface_v2.rs +++ b/src/ifs/wl_surface/zwp_input_popup_surface_v2.rs @@ -127,7 +127,7 @@ impl ZwpInputPopupSurfaceV2 { Ok(()) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_text_input_rectangle(&self, rect: Rect) { self.client.event(TextInputRectangle { self_id: self.id, diff --git a/src/ifs/wp_drm_lease_connector_v1.rs b/src/ifs/wp_drm_lease_connector_v1.rs index 868a8412..136babd8 100644 --- a/src/ifs/wp_drm_lease_connector_v1.rs +++ b/src/ifs/wp_drm_lease_connector_v1.rs @@ -34,7 +34,7 @@ impl WpDrmLeaseConnectorV1 { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_description(&self, description: &str) { self.client.event(Description { self_id: self.id, diff --git a/src/ifs/wp_presentation_feedback.rs b/src/ifs/wp_presentation_feedback.rs index a8d94f94..d926c5a8 100644 --- a/src/ifs/wp_presentation_feedback.rs +++ b/src/ifs/wp_presentation_feedback.rs @@ -19,10 +19,10 @@ pub struct WpPresentationFeedback { } pub const KIND_VSYNC: u32 = 0x1; -#[allow(dead_code)] +#[expect(dead_code)] pub const KIND_HW_CLOCK: u32 = 0x2; pub const KIND_HW_COMPLETION: u32 = 0x4; -#[allow(dead_code)] +#[expect(dead_code)] pub const KIND_ZERO_COPY: u32 = 0x8; impl WpPresentationFeedback { diff --git a/src/ifs/xdg_wm_base.rs b/src/ifs/xdg_wm_base.rs index adeec9c0..c6bcfb3b 100644 --- a/src/ifs/xdg_wm_base.rs +++ b/src/ifs/xdg_wm_base.rs @@ -15,16 +15,16 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const ROLE: u32 = 0; const DEFUNCT_SURFACES: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const NOT_THE_TOPMOST_POPUP: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_POPUP_PARENT: u32 = 3; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_SURFACE_STATE: u32 = 4; -#[allow(dead_code)] +#[expect(dead_code)] const INVALID_POSITIONER: u32 = 5; pub struct XdgWmBaseGlobal { diff --git a/src/ifs/zwlr_screencopy_frame_v1.rs b/src/ifs/zwlr_screencopy_frame_v1.rs index 66d7cbe1..a304c830 100644 --- a/src/ifs/zwlr_screencopy_frame_v1.rs +++ b/src/ifs/zwlr_screencopy_frame_v1.rs @@ -15,7 +15,7 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] pub const FLAGS_Y_INVERT: u32 = 1; pub struct ZwlrScreencopyFrameV1 { @@ -81,7 +81,7 @@ impl ZwlrScreencopyFrameV1 { self.client.event(BufferDone { self_id: self.id }) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_flags(&self, flags: u32) { self.client.event(Flags { self_id: self.id, diff --git a/src/ifs/zwp_linux_buffer_params_v1.rs b/src/ifs/zwp_linux_buffer_params_v1.rs index 025cbc1b..772da4fd 100644 --- a/src/ifs/zwp_linux_buffer_params_v1.rs +++ b/src/ifs/zwp_linux_buffer_params_v1.rs @@ -17,11 +17,11 @@ use { thiserror::Error, }; -#[allow(dead_code)] +#[expect(dead_code)] const Y_INVERT: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const INTERLACED: u32 = 2; -#[allow(dead_code)] +#[expect(dead_code)] const BOTTOM_FIRST: u32 = 4; const MAX_PLANE: u32 = MAX_PLANES as u32 - 1; diff --git a/src/ifs/zwp_linux_dmabuf_feedback_v1.rs b/src/ifs/zwp_linux_dmabuf_feedback_v1.rs index 172d6d8c..a8be2da8 100644 --- a/src/ifs/zwp_linux_dmabuf_feedback_v1.rs +++ b/src/ifs/zwp_linux_dmabuf_feedback_v1.rs @@ -12,7 +12,6 @@ use { uapi::{c, OwnedFd}, }; -#[allow(dead_code)] pub const SCANOUT: u32 = 1; pub struct ZwpLinuxDmabufFeedbackV1 { diff --git a/src/ifs/zxdg_output_v1.rs b/src/ifs/zxdg_output_v1.rs index a309f751..a698fb6e 100644 --- a/src/ifs/zxdg_output_v1.rs +++ b/src/ifs/zxdg_output_v1.rs @@ -11,7 +11,7 @@ use { }; pub const NAME_SINCE: Version = Version(2); -#[allow(dead_code)] +#[expect(dead_code)] pub const DESCRIPTION_SINCE: Version = Version(2); pub const NO_DONE_SINCE: Version = Version(3); @@ -51,7 +51,7 @@ impl ZxdgOutputV1 { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn send_description(&self, description: &str) { self.client.event(Description { self_id: self.id, diff --git a/src/io_uring/ops/poll.rs b/src/io_uring/ops/poll.rs index d8b9ce40..6edab2d4 100644 --- a/src/io_uring/ops/poll.rs +++ b/src/io_uring/ops/poll.rs @@ -32,7 +32,7 @@ impl IoUring { self.poll(fd, c::POLLIN).await.merge() } - #[allow(dead_code)] + #[expect(dead_code)] pub async fn writable(&self, fd: &Rc) -> Result { self.poll(fd, c::POLLOUT).await.merge() } diff --git a/src/io_uring/ops/timeout.rs b/src/io_uring/ops/timeout.rs index c91aceb9..3567a56f 100644 --- a/src/io_uring/ops/timeout.rs +++ b/src/io_uring/ops/timeout.rs @@ -7,7 +7,6 @@ use { uapi::c, }; -#[allow(non_camel_case_types)] #[repr(C)] #[derive(Default)] pub(super) struct timespec64 { diff --git a/src/it/test_client.rs b/src/it/test_client.rs index 7bb2c4cc..83db6ace 100644 --- a/src/it/test_client.rs +++ b/src/it/test_client.rs @@ -47,7 +47,7 @@ pub struct DefaultSeat { } impl TestClient { - #[allow(dead_code)] + #[expect(dead_code)] pub fn error(&self, msg: &str) { self.tran.error(msg) } @@ -97,7 +97,7 @@ impl TestClient { Ok(qoi) } - #[allow(dead_code)] + #[expect(dead_code)] pub async fn save_screenshot(&self, name: &str, include_cursor: bool) -> Result<(), TestError> { let qoi = self.take_screenshot(include_cursor).await?; let path = format!("{}/screenshot_{}.qoi", self.run.out_dir, name); diff --git a/src/it/test_ifs/test_cursor_shape_device.rs b/src/it/test_ifs/test_cursor_shape_device.rs index 48e17501..f553e9f4 100644 --- a/src/it/test_ifs/test_cursor_shape_device.rs +++ b/src/it/test_ifs/test_cursor_shape_device.rs @@ -13,7 +13,7 @@ pub struct TestCursorShapeDevice { } impl TestCursorShapeDevice { - #[allow(dead_code)] + #[expect(dead_code)] pub fn destroy(&self) -> TestResult { if !self.destroyed.replace(true) { self.tran.send(Destroy { self_id: self.id })?; diff --git a/src/it/test_ifs/test_cursor_shape_manager.rs b/src/it/test_ifs/test_cursor_shape_manager.rs index 5f61fae9..c7ed66eb 100644 --- a/src/it/test_ifs/test_cursor_shape_manager.rs +++ b/src/it/test_ifs/test_cursor_shape_manager.rs @@ -28,7 +28,7 @@ impl TestCursorShapeManager { } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn destroy(&self) -> TestResult { if !self.destroyed.replace(true) { self.tran.send(Destroy { self_id: self.id })?; diff --git a/src/it/test_ifs/test_data_control_device.rs b/src/it/test_ifs/test_data_control_device.rs index f15941b2..883badf3 100644 --- a/src/it/test_ifs/test_data_control_device.rs +++ b/src/it/test_ifs/test_data_control_device.rs @@ -29,7 +29,7 @@ pub struct TestDataControlDevice { } impl TestDataControlDevice { - #[allow(dead_code)] + #[expect(dead_code)] pub fn destroy(&self) -> TestResult { if !self.destroyed.replace(true) { self.tran.send(Destroy { self_id: self.id })?; @@ -45,7 +45,7 @@ impl TestDataControlDevice { Ok(()) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_primary_selection(&self, source: &TestDataControlSource) -> TestResult { self.tran.send(SetPrimarySelection { self_id: self.id, diff --git a/src/it/test_ifs/test_data_device.rs b/src/it/test_ifs/test_data_device.rs index 3bbbb744..9022f3fe 100644 --- a/src/it/test_ifs/test_data_device.rs +++ b/src/it/test_ifs/test_data_device.rs @@ -47,7 +47,6 @@ impl TestDataDevice { Ok(()) } - #[allow(dead_code)] pub fn set_selection(&self, source: &TestDataSource, serial: u32) -> TestResult { self.tran.send(SetSelection { self_id: self.id, diff --git a/src/it/test_ifs/test_data_source.rs b/src/it/test_ifs/test_data_source.rs index 4c2ff9f7..00175412 100644 --- a/src/it/test_ifs/test_data_source.rs +++ b/src/it/test_ifs/test_data_source.rs @@ -26,7 +26,6 @@ impl TestDataSource { Ok(()) } - #[allow(dead_code)] pub fn offer(&self, mime_type: &str) -> TestResult { self.tran.send(Offer { self_id: self.id, @@ -35,7 +34,6 @@ impl TestDataSource { Ok(()) } - #[allow(dead_code)] pub fn set_actions(&self, actions: u32) -> TestResult { self.tran.send(SetActions { self_id: self.id, diff --git a/src/it/test_ifs/test_dmabuf.rs b/src/it/test_ifs/test_dmabuf.rs index 21f31103..8323d5c0 100644 --- a/src/it/test_ifs/test_dmabuf.rs +++ b/src/it/test_ifs/test_dmabuf.rs @@ -33,7 +33,7 @@ impl TestDmabuf { Ok(()) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn get_default_feedback(&self) -> TestResult> { let obj = Rc::new(TestDmabufFeedback::new(&self.tran)); self.tran.add_obj(obj.clone())?; diff --git a/src/it/test_ifs/test_ext_foreign_toplevel_list.rs b/src/it/test_ifs/test_ext_foreign_toplevel_list.rs index ca0dc137..bfd2784d 100644 --- a/src/it/test_ifs/test_ext_foreign_toplevel_list.rs +++ b/src/it/test_ifs/test_ext_foreign_toplevel_list.rs @@ -33,7 +33,7 @@ impl TestExtForeignToplevelList { } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn stop(&self) -> TestResult { self.tran.send(Stop { self_id: self.id })?; Ok(()) diff --git a/src/it/test_ifs/test_input_method.rs b/src/it/test_ifs/test_input_method.rs index 1d97182b..9a929bae 100644 --- a/src/it/test_ifs/test_input_method.rs +++ b/src/it/test_ifs/test_input_method.rs @@ -41,7 +41,7 @@ impl TestInputMethod { }) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn grab(&self) -> TestResult> { let obj = Rc::new(TestInputMethodKeyboardGrab { id: self.tran.id(), diff --git a/src/it/test_ifs/test_shm.rs b/src/it/test_ifs/test_shm.rs index 37d494ab..a2a4e97b 100644 --- a/src/it/test_ifs/test_shm.rs +++ b/src/it/test_ifs/test_shm.rs @@ -39,7 +39,6 @@ impl TestShm { &self.formats } - #[allow(dead_code)] pub fn create_pool(&self, size: usize) -> Result, TestError> { let mem = TestMem::new(size)?; let pool = Rc::new(TestShmPool { @@ -58,7 +57,6 @@ impl TestShm { Ok(pool) } - #[allow(dead_code)] pub fn create_buffer(&self, width: i32, height: i32) -> TestResult> { let pool = self.create_pool((width * height * 4) as _)?; pool.create_buffer(0, width, height, width * 4, ARGB8888) diff --git a/src/it/test_ifs/test_shm_buffer.rs b/src/it/test_ifs/test_shm_buffer.rs index 93cb7c3f..ffe4bdf9 100644 --- a/src/it/test_ifs/test_shm_buffer.rs +++ b/src/it/test_ifs/test_shm_buffer.rs @@ -18,7 +18,6 @@ pub struct TestShmBuffer { } impl TestShmBuffer { - #[allow(dead_code)] pub fn fill(&self, color: Color) { let [cr, cg, cb, ca] = color.to_rgba_premultiplied(); for [b, g, r, a] in self.deref().array_chunks_ext::<4>() { diff --git a/src/it/test_ifs/test_shm_pool.rs b/src/it/test_ifs/test_shm_pool.rs index 639a6b4d..4c4aaec0 100644 --- a/src/it/test_ifs/test_shm_pool.rs +++ b/src/it/test_ifs/test_shm_pool.rs @@ -22,7 +22,6 @@ pub struct TestShmPool { } impl TestShmPool { - #[allow(dead_code)] pub fn create_buffer( &self, offset: i32, @@ -61,7 +60,7 @@ impl TestShmPool { Ok(buffer) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn resize(&self, size: usize) -> Result<(), TestError> { let mem = self.mem.get().grow(size)?; self.mem.set(mem); diff --git a/src/it/test_ifs/test_subsurface.rs b/src/it/test_ifs/test_subsurface.rs index caf7dd85..fd1cd051 100644 --- a/src/it/test_ifs/test_subsurface.rs +++ b/src/it/test_ifs/test_subsurface.rs @@ -44,12 +44,11 @@ impl TestSubsurface { }) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_sync(&self) -> Result<(), TestError> { self.tran.send(SetSync { self_id: self.id }) } - #[allow(dead_code)] pub fn set_desync(&self) -> Result<(), TestError> { self.tran.send(SetDesync { self_id: self.id }) } diff --git a/src/it/test_mem.rs b/src/it/test_mem.rs index fbdd9256..236808b3 100644 --- a/src/it/test_mem.rs +++ b/src/it/test_mem.rs @@ -13,7 +13,6 @@ pub struct TestMem { } impl TestMem { - #[allow(dead_code)] pub fn new(size: usize) -> Result, TestError> { let fd = uapi::memfd_create("test_pool", c::MFD_CLOEXEC | c::MFD_ALLOW_SEALING)?; uapi::fcntl_add_seals(fd.raw(), c::F_SEAL_SHRINK)?; @@ -25,7 +24,6 @@ impl TestMem { })) } - #[allow(dead_code)] pub fn grow(&self, size: usize) -> Result, TestError> { let cur_len = uapi::fstat(self.fd.raw())?; if size > cur_len.st_size as _ { @@ -47,7 +45,6 @@ impl Deref for TestMem { } } -#[allow(dead_code)] fn map(fd: c::c_int, size: usize) -> Result<*const [Cell], TestError> { if size == 0 { return Ok(&[]); diff --git a/src/it/test_object.rs b/src/it/test_object.rs index a19d32bd..1860de1c 100644 --- a/src/it/test_object.rs +++ b/src/it/test_object.rs @@ -14,7 +14,7 @@ macro_rules! test_object { self.id.into() } - #[allow(unused_variables, unreachable_code)] + #[allow(clippy::allow_attributes, unused_variables, unreachable_code)] fn handle_request( self: std::rc::Rc, request: u32, diff --git a/src/it/test_utils/test_expected_event.rs b/src/it/test_utils/test_expected_event.rs index 4e5b0f0f..8af0ab62 100644 --- a/src/it/test_utils/test_expected_event.rs +++ b/src/it/test_utils/test_expected_event.rs @@ -17,7 +17,6 @@ impl TestExpectedEvent { } } - #[allow(dead_code)] pub fn last(&self) -> TestResult { match self.data.events.borrow_mut().pop_back() { Some(t) => Ok(t), diff --git a/src/it/test_utils/test_surface_ext.rs b/src/it/test_utils/test_surface_ext.rs index 315b3576..4bafe68d 100644 --- a/src/it/test_utils/test_surface_ext.rs +++ b/src/it/test_utils/test_surface_ext.rs @@ -38,7 +38,6 @@ impl TestSurfaceExt { Ok(()) } - #[allow(dead_code)] pub fn set_color(&self, r: u8, g: u8, b: u8, a: u8) { self.color.set(Color::from_rgba_straight(r, g, b, a)); } diff --git a/src/libinput/device.rs b/src/libinput/device.rs index bf217781..b32889f8 100644 --- a/src/libinput/device.rs +++ b/src/libinput/device.rs @@ -169,7 +169,6 @@ impl<'a> LibInputDevice<'a> { } } - #[allow(dead_code)] pub fn drag_enabled(&self) -> bool { let enabled = unsafe { ConfigDragState(libinput_device_config_tap_get_drag_enabled(self.dev)) }; @@ -189,7 +188,6 @@ impl<'a> LibInputDevice<'a> { } } - #[allow(dead_code)] pub fn drag_lock_enabled(&self) -> bool { let enabled = unsafe { ConfigDragLockState(libinput_device_config_tap_get_drag_lock_enabled(self.dev)) diff --git a/src/libinput/event.rs b/src/libinput/event.rs index 3048a0fb..abd87765 100644 --- a/src/libinput/event.rs +++ b/src/libinput/event.rs @@ -178,7 +178,6 @@ impl<'a> LibInputEventKeyboard<'a> { unsafe { KeyState(libinput_event_keyboard_get_key_state(self.event)) } } - #[allow(dead_code)] pub fn time_usec(&self) -> u64 { unsafe { libinput_event_keyboard_get_time_usec(self.event) } } diff --git a/src/macros.rs b/src/macros.rs index 41cd330c..0761ecbf 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -109,7 +109,7 @@ macro_rules! id { #[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)] pub struct $name(u32); - #[allow(dead_code)] + #[expect(dead_code)] impl $name { pub const NONE: Self = $name(0); @@ -159,12 +159,12 @@ macro_rules! shared_ids { pub struct $id($ty); impl $id { - #[allow(dead_code)] + #[expect(dead_code)] pub fn raw(&self) -> $ty { self.0 } - #[allow(dead_code)] + #[expect(dead_code)] pub fn from_raw(id: $ty) -> Self { Self(id) } @@ -211,12 +211,12 @@ macro_rules! linear_ids { pub struct $id($ty); impl $id { - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub fn raw(&self) -> $ty { self.0 } - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub fn from_raw(id: $ty) -> Self { Self(id) } @@ -277,12 +277,12 @@ macro_rules! tree_id { pub struct $id(u32); impl $id { - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub fn raw(&self) -> u32 { self.0 } - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub fn none() -> Self { Self(0) } @@ -382,7 +382,7 @@ macro_rules! assert_size_eq { }}; } -#[allow(unused_macros)] +#[expect(unused_macros)] macro_rules! assert_size_le { ($t:ty, $u:ty) => {{ struct AssertLeSize(std::marker::PhantomData, std::marker::PhantomData); @@ -418,7 +418,7 @@ macro_rules! atoms { $name:ident; $($field_name:ident,)* } => { - #[allow(non_snake_case, dead_code)] + #[expect(non_snake_case, dead_code)] #[derive(Debug, Clone, Copy)] struct $name { $( @@ -471,11 +471,11 @@ macro_rules! bitflags { pub struct $name(pub $rep); $( - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] pub const $var: $name = $name($val); )* - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] impl $name { pub fn none() -> Self { Self(0) @@ -549,7 +549,7 @@ macro_rules! bitflags { } impl std::fmt::Debug for $name { - #[allow(clippy::bad_bit_mask)] + #[allow(clippy::allow_attributes, clippy::bad_bit_mask)] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let mut any = false; let mut v = self.0; @@ -578,14 +578,13 @@ macro_rules! bitflags { macro_rules! pw_opcodes { ($name:ident; $($var:ident = $val:expr,)*) => { #[derive(Copy, Clone, Debug)] - #[allow(dead_code)] pub enum $name { $( $var, )* } - #[allow(dead_code)] + #[allow(clippy::allow_attributes, dead_code)] impl $name { pub fn from_id(id: u8) -> Option { let v = match id { @@ -661,7 +660,7 @@ macro_rules! ei_id { #[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)] pub struct $name(u64); - #[allow(dead_code)] + #[expect(dead_code)] impl $name { pub const NONE: Self = $name(0); diff --git a/src/main.rs b/src/main.rs index 5e3872b5..82655149 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ clippy::unnecessary_cast, clippy::manual_flatten )] +#![warn(clippy::allow_attributes)] #[macro_use] mod macros; diff --git a/src/object.rs b/src/object.rs index eca34cd6..728def76 100644 --- a/src/object.rs +++ b/src/object.rs @@ -18,7 +18,7 @@ pub const WL_DISPLAY_ID: WlDisplayId = WlDisplayId::from_raw(1); pub struct ObjectId(u32); impl ObjectId { - #[allow(dead_code)] + #[expect(dead_code)] pub const NONE: Self = ObjectId(0); pub fn from_raw(raw: u32) -> Self { @@ -39,7 +39,7 @@ impl Display for ObjectId { pub trait ObjectBase { fn id(&self) -> ObjectId; fn version(&self) -> Version; - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] fn into_any(self: Rc) -> Rc; fn handle_request( self: Rc, diff --git a/src/pipewire/pw_con.rs b/src/pipewire/pw_con.rs index 940a9688..099d92c6 100644 --- a/src/pipewire/pw_con.rs +++ b/src/pipewire/pw_con.rs @@ -201,7 +201,7 @@ impl PwCon { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn sync(&self, p: &P) { let seq = p.data().sync_id.fetch_add(1) + 1; self.send2(0, "core", PwCoreMethods::Sync, |f| { @@ -218,7 +218,7 @@ impl PwCon { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn get_registry(self: &Rc) -> Rc { let registry = Rc::new(PwRegistry { data: self.proxy_data(), diff --git a/src/pipewire/pw_formatter.rs b/src/pipewire/pw_formatter.rs index 775644e6..c10eb02a 100644 --- a/src/pipewire/pw_formatter.rs +++ b/src/pipewire/pw_formatter.rs @@ -92,7 +92,7 @@ impl<'a> PwFormatter<'a> { self.first = false; } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_float(&mut self, float: f32) { if !self.array || self.first { self.data.extend_from_slice(uapi::as_bytes(&4u32)); @@ -106,7 +106,7 @@ impl<'a> PwFormatter<'a> { self.first = false; } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_double(&mut self, double: f64) { if !self.array || self.first { self.data.extend_from_slice(uapi::as_bytes(&8u32)); @@ -127,7 +127,7 @@ impl<'a> PwFormatter<'a> { self.pad(); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_bytes(&mut self, s: &[u8]) { self.data .extend_from_slice(uapi::as_bytes(&(s.len() as u32))); @@ -148,7 +148,7 @@ impl<'a> PwFormatter<'a> { self.first = false; } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_fraction(&mut self, num: i32, denom: i32) { if !self.array || self.first { self.data.extend_from_slice(uapi::as_bytes(&8u32)); @@ -168,7 +168,7 @@ impl<'a> PwFormatter<'a> { self.first = false; } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_bitmap(&mut self, s: &[u8]) { self.data .extend_from_slice(uapi::as_bytes(&(s.len() as u32))); @@ -178,7 +178,6 @@ impl<'a> PwFormatter<'a> { self.pad(); } - #[allow(dead_code)] pub fn write_fd(&mut self, fd: &Rc) { let pos = self.fds.len() as u64; self.fds.push(fd.clone()); @@ -205,7 +204,7 @@ impl<'a> PwFormatter<'a> { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn write_array(&mut self, f: F) where F: FnOnce(&mut PwFormatter), diff --git a/src/pipewire/pw_ifs/pw_client_node.rs b/src/pipewire/pw_ifs/pw_client_node.rs index f998a584..53e2b141 100644 --- a/src/pipewire/pw_ifs/pw_client_node.rs +++ b/src/pipewire/pw_ifs/pw_client_node.rs @@ -202,12 +202,12 @@ pub const PW_CLIENT_NODE_FACTORY: &str = "client-node"; pub const PW_CLIENT_NODE_INTERFACE: &str = "PipeWire:Interface:ClientNode"; pub const PW_CLIENT_NODE_VERSION: i32 = 4; -#[allow(dead_code)] +#[expect(dead_code)] const PW_CLIENT_NODE_UPDATE_PARAMS: u32 = 1 << 0; const PW_CLIENT_NODE_UPDATE_INFO: u32 = 1 << 1; const SPA_NODE_CHANGE_MASK_FLAGS: u64 = 1 << 0; -#[allow(dead_code)] +#[expect(dead_code)] const SPA_NODE_CHANGE_MASK_PROPS: u64 = 1 << 1; const SPA_NODE_CHANGE_MASK_PARAMS: u64 = 1 << 2; @@ -216,7 +216,7 @@ const PW_CLIENT_NODE_PORT_UPDATE_INFO: u32 = 1 << 1; const SPA_PORT_CHANGE_MASK_FLAGS: u64 = 1 << 0; const SPA_PORT_CHANGE_MASK_RATE: u64 = 1 << 1; -#[allow(dead_code)] +#[expect(dead_code)] const SPA_PORT_CHANGE_MASK_PROPS: u64 = 1 << 2; const SPA_PORT_CHANGE_MASK_PARAMS: u64 = 1 << 3; diff --git a/src/pipewire/pw_mem.rs b/src/pipewire/pw_mem.rs index 37a4c113..7954a9ea 100644 --- a/src/pipewire/pw_mem.rs +++ b/src/pipewire/pw_mem.rs @@ -41,7 +41,7 @@ pub struct PwMemTyped { _phantom: PhantomData, } -#[allow(dead_code)] +#[expect(dead_code)] pub struct PwMemSlice { mem: Rc, range: Range, @@ -85,19 +85,19 @@ impl PwMem { } impl PwMemMap { - #[allow(dead_code)] + #[expect(dead_code)] pub unsafe fn read(&self) -> &T { self.check::(0); (self.map.ptr.cast::().add(self.range.start) as *const T).deref() } - #[allow(dead_code)] + #[expect(dead_code)] pub unsafe fn write(&self) -> &mut T { self.check::(0); (self.map.ptr.cast::().add(self.range.start) as *mut T).deref_mut() } - #[allow(dead_code)] + #[expect(dead_code)] pub unsafe fn bytes_mut(&self) -> &mut [u8] { std::slice::from_raw_parts_mut( self.map.ptr.cast::().add(self.range.start) as _, @@ -135,7 +135,6 @@ impl PwMemMap { } impl PwMemTyped { - #[allow(dead_code)] pub unsafe fn read(&self) -> &T { (self.mem.map.ptr.cast::().add(self.offset) as *const T).deref() } diff --git a/src/portal.rs b/src/portal.rs index 368a435b..574a864c 100644 --- a/src/portal.rs +++ b/src/portal.rs @@ -50,9 +50,9 @@ use { }; const PORTAL_SUCCESS: u32 = 0; -#[allow(dead_code)] +#[expect(dead_code)] const PORTAL_CANCELLED: u32 = 1; -#[allow(dead_code)] +#[expect(dead_code)] const PORTAL_ENDED: u32 = 2; pub fn run_freestanding(global: GlobalArgs) { diff --git a/src/portal/ptr_gui.rs b/src/portal/ptr_gui.rs index 5926b11f..828a7d3f 100644 --- a/src/portal/ptr_gui.rs +++ b/src/portal/ptr_gui.rs @@ -342,11 +342,11 @@ impl GuiElement for Label { #[derive(Copy, Clone, Eq, PartialEq, Default)] pub enum Align { - #[allow(dead_code)] + #[expect(dead_code)] Left, #[default] Center, - #[allow(dead_code)] + #[expect(dead_code)] Right, } @@ -354,7 +354,6 @@ pub enum Align { pub enum Orientation { #[default] Horizontal, - #[allow(dead_code)] Vertical, } diff --git a/src/rect.rs b/src/rect.rs index a721e6da..df9dedd7 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -51,7 +51,6 @@ impl RectOverflow { } impl Rect { - #[allow(dead_code)] pub fn new_empty(x: i32, y: i32) -> Self { Self { raw: RectRaw { @@ -72,7 +71,7 @@ impl Rect { }) } - #[allow(dead_code)] + #[expect(dead_code)] fn new_unchecked(x1: i32, y1: i32, x2: i32, y2: i32) -> Self { Self { raw: RectRaw { x1, y1, x2, y2 }, @@ -139,7 +138,7 @@ impl Rect { dx * dx + dy * dy } - #[allow(dead_code)] + #[expect(dead_code)] pub fn contains_rect(&self, rect: &Self) -> bool { self.raw.x1 <= rect.raw.x1 && self.raw.y1 <= rect.raw.x1 @@ -160,7 +159,7 @@ impl Rect { self.raw.x1 == self.raw.x2 || self.raw.y1 == self.raw.y2 } - #[allow(dead_code)] + #[expect(dead_code)] pub fn to_origin(&self) -> Self { Self { raw: RectRaw { diff --git a/src/rect/region.rs b/src/rect/region.rs index cf9e8c86..262950d3 100644 --- a/src/rect/region.rs +++ b/src/rect/region.rs @@ -73,7 +73,7 @@ impl Region { }) } - #[allow(dead_code)] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn extents(&self) -> Rect { self.extents } @@ -148,7 +148,7 @@ impl RegionBuilder { self.base.clone() } - #[allow(dead_code)] + #[expect(dead_code)] pub fn clear(&mut self) { self.pending.clear(); self.base = Region::empty(); diff --git a/src/state.rs b/src/state.rs index 50cd36d0..98636a3d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1112,7 +1112,6 @@ impl State { self.eng.now().usec() } - #[allow(dead_code)] pub fn now_msec(&self) -> u64 { self.eng.now().msec() } diff --git a/src/tasks/drmdev.rs b/src/tasks/drmdev.rs index 38d6c95b..5aeed350 100644 --- a/src/tasks/drmdev.rs +++ b/src/tasks/drmdev.rs @@ -59,7 +59,6 @@ impl DrvDevHandler { } self.log_gfx_api(); 'outer: loop { - #[allow(clippy::never_loop)] while let Some(event) = self.data.dev.event() { match event { DrmEvent::Removed => break 'outer, diff --git a/src/theme.rs b/src/theme.rs index 6089adca..ef351d31 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -47,7 +47,6 @@ fn to_f32(c: u8) -> f32 { c as f32 / 255f32 } -#[allow(dead_code)] fn to_u8(c: f32) -> u8 { (c * 255f32).round() as u8 } @@ -80,7 +79,7 @@ impl Color { } } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn from_rgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Self { Self { r: to_f32(r), @@ -112,7 +111,7 @@ impl Color { } } - #[allow(dead_code)] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn to_rgba_premultiplied(self) -> [u8; 4] { [to_u8(self.r), to_u8(self.g), to_u8(self.b), to_u8(self.a)] } @@ -121,7 +120,7 @@ impl Color { [self.r, self.g, self.b, self.a] } - #[allow(dead_code)] + #[expect(dead_code)] pub fn to_array_linear(self) -> [f32; 4] { fn to_linear(srgb: f32) -> f32 { if srgb <= 0.04045 { @@ -138,7 +137,7 @@ impl Color { ] } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn and_then(self, other: &Color) -> Color { Color { r: self.r * (1.0 - other.a) + other.r, @@ -218,7 +217,7 @@ macro_rules! sizes { } #[derive(Copy, Clone, Debug)] - #[allow(non_camel_case_types)] + #[expect(non_camel_case_types)] pub enum ThemeSized { $( $name, diff --git a/src/tools/tool_client.rs b/src/tools/tool_client.rs index b045a236..fe88bc6e 100644 --- a/src/tools/tool_client.rs +++ b/src/tools/tool_client.rs @@ -373,7 +373,7 @@ pub trait Handle: RequestParser<'static> { R: 'static, H: for<'a> Fn(&R, Self::Generic<'a>) + 'static; - #[allow(dead_code)] + #[expect(dead_code)] fn handle2(tl: &Rc, id: impl Into, r: R, h: H) where R: 'static, diff --git a/src/tree.rs b/src/tree.rs index 797820c1..4e4f1c13 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -84,7 +84,7 @@ impl NodeIds { pub struct NodeId(pub u32); impl NodeId { - #[allow(dead_code)] + #[expect(dead_code)] pub fn raw(&self) -> u32 { self.0 } @@ -508,7 +508,7 @@ pub trait Node: 'static { // TYPE CONVERTERS - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] fn node_into_float(self: Rc) -> Option> { None } diff --git a/src/tree/container.rs b/src/tree/container.rs index 6f0c6563..af6f6171 100644 --- a/src/tree/container.rs +++ b/src/tree/container.rs @@ -44,7 +44,6 @@ use { }, }; -#[allow(dead_code)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum ContainerSplit { Horizontal, @@ -69,7 +68,7 @@ impl Into for ContainerSplit { } } -#[allow(dead_code)] +#[expect(dead_code)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum ContainerFocus { None, diff --git a/src/udev.rs b/src/udev.rs index 0cef0e28..777e76e4 100644 --- a/src/udev.rs +++ b/src/udev.rs @@ -45,7 +45,7 @@ extern "C" { fn udev_list_entry_get_next(list_entry: *mut udev_list_entry) -> *mut udev_list_entry; fn udev_list_entry_get_name(list_entry: *mut udev_list_entry) -> *const c::c_char; - #[allow(dead_code)] + #[expect(dead_code)] fn udev_list_entry_get_value(list_entry: *mut udev_list_entry) -> *const c::c_char; fn udev_device_new_from_syspath(udev: *mut udev, syspath: *const c::c_char) @@ -56,7 +56,7 @@ extern "C" { fn udev_device_get_is_initialized(udev_device: *mut udev_device) -> c::c_int; fn udev_device_get_devnode(udev_device: *mut udev_device) -> *const c::c_char; fn udev_device_get_syspath(udev_device: *mut udev_device) -> *const c::c_char; - fn udev_device_get_devtype(udev_device: *mut udev_device) -> *const c::c_char; + // fn udev_device_get_devtype(udev_device: *mut udev_device) -> *const c::c_char; fn udev_device_get_devnum(udev_device: *mut udev_device) -> c::dev_t; fn udev_device_get_action(udev_device: *mut udev_device) -> *const c::c_char; fn udev_device_get_subsystem(udev_device: *mut udev_device) -> *const c::c_char; @@ -124,7 +124,7 @@ pub struct UdevDevice { pub enum UdevDeviceType { Character, - #[allow(dead_code)] + #[expect(dead_code)] Block, } @@ -332,7 +332,6 @@ impl<'a> UdevListEntry<'a> { macro_rules! strfn { ($f:ident, $raw:ident) => { - #[allow(dead_code)] pub fn $f(&self) -> Option<&CStr> { let res = unsafe { $raw(self.device) }; if res.is_null() { @@ -348,7 +347,7 @@ impl UdevDevice { strfn!(sysname, udev_device_get_sysname); strfn!(syspath, udev_device_get_syspath); strfn!(devnode, udev_device_get_devnode); - strfn!(devtype, udev_device_get_devtype); + // strfn!(devtype, udev_device_get_devtype); strfn!(action, udev_device_get_action); strfn!(subsystem, udev_device_get_subsystem); @@ -370,7 +369,6 @@ impl UdevDevice { }) } - #[allow(dead_code)] pub fn is_initialized(&self) -> bool { unsafe { udev_device_get_is_initialized(self.device) != 0 } } diff --git a/src/udmabuf.rs b/src/udmabuf.rs index c20b66ac..d8766e11 100644 --- a/src/udmabuf.rs +++ b/src/udmabuf.rs @@ -259,7 +259,6 @@ impl From for AllocatorError { } } -#[allow(non_camel_case_types)] #[repr(C)] struct udmabuf_create { memfd: u32, diff --git a/src/utils/buffd/ei_formatter.rs b/src/utils/buffd/ei_formatter.rs index d04b1507..8621da11 100644 --- a/src/utils/buffd/ei_formatter.rs +++ b/src/utils/buffd/ei_formatter.rs @@ -42,7 +42,7 @@ impl<'a> EiMsgFormatter<'a> { self } - #[allow(dead_code)] + #[expect(dead_code)] pub fn long(&mut self, int: i64) -> &mut Self { self.write(uapi::as_bytes(&int)); self diff --git a/src/utils/buffd/formatter.rs b/src/utils/buffd/formatter.rs index fd7cc9ae..277f895c 100644 --- a/src/utils/buffd/formatter.rs +++ b/src/utils/buffd/formatter.rs @@ -79,7 +79,7 @@ impl<'a> MsgFormatter<'a> { self.object(obj).uint(event) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn array)>(&mut self, f: F) -> &mut Self { let pos = self.meta.write_pos; self.uint(0); diff --git a/src/utils/buffd/parser.rs b/src/utils/buffd/parser.rs index 40f55cc3..9c98123d 100644 --- a/src/utils/buffd/parser.rs +++ b/src/utils/buffd/parser.rs @@ -59,12 +59,11 @@ impl<'a, 'b> MsgParser<'a, 'b> { self.int().map(|i| ObjectId::from_raw(i as u32).into()) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn global(&mut self) -> Result { self.int().map(|i| GlobalName::from_raw(i as u32)) } - #[allow(dead_code)] pub fn fixed(&mut self) -> Result { self.int().map(Fixed) } diff --git a/src/utils/clone3.rs b/src/utils/clone3.rs index 4b096bd3..0d0c517b 100644 --- a/src/utils/clone3.rs +++ b/src/utils/clone3.rs @@ -5,7 +5,7 @@ use { }; #[derive(Default, Copy, Clone)] -#[allow(non_camel_case_types, dead_code)] +#[expect(non_camel_case_types, dead_code)] struct clone_args { flags: u64, pidfd: u64, diff --git a/src/utils/clonecell.rs b/src/utils/clonecell.rs index f7b20d46..08597b75 100644 --- a/src/utils/clonecell.rs +++ b/src/utils/clonecell.rs @@ -66,7 +66,6 @@ impl CloneCell> { } #[inline(always)] - #[allow(dead_code)] pub fn is_none(&self) -> bool { unsafe { self.data.get().deref().is_none() } } diff --git a/src/utils/linkedlist.rs b/src/utils/linkedlist.rs index d3c7084c..35974dde 100644 --- a/src/utils/linkedlist.rs +++ b/src/utils/linkedlist.rs @@ -74,7 +74,6 @@ impl LinkedList { unsafe { self.endpoint(self.root.data.as_ref().prev.get()) } } - #[allow(dead_code)] pub fn first(&self) -> Option> { unsafe { self.endpoint(self.root.data.as_ref().next.get()) } } @@ -91,7 +90,7 @@ impl LinkedList { self.root.prepend_existing(t) } - #[allow(dead_code)] + #[expect(dead_code)] pub fn add_first_existing(&self, t: &NodeRef) { self.root.append_existing(t) } diff --git a/src/utils/num_cpus.rs b/src/utils/num_cpus.rs index 8f4ffa08..53e576f7 100644 --- a/src/utils/num_cpus.rs +++ b/src/utils/num_cpus.rs @@ -4,7 +4,7 @@ use { uapi::{c, Errno}, }; -#[allow(dead_code)] +#[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn num_cpus() -> Result { let mut buf: SmallVec<[usize; 32]> = smallvec_inline![0; 32]; loop { diff --git a/src/utils/oserror.rs b/src/utils/oserror.rs index aa7c8411..8fafdc15 100644 --- a/src/utils/oserror.rs +++ b/src/utils/oserror.rs @@ -205,7 +205,7 @@ impl Display for OsError { } } -#[cfg_attr(not(feature = "it"), allow(dead_code))] +#[cfg_attr(not(feature = "it"), expect(dead_code))] pub trait OsErrorExt { type Container; diff --git a/src/utils/timer.rs b/src/utils/timer.rs index 4a32eb07..05a53a79 100644 --- a/src/utils/timer.rs +++ b/src/utils/timer.rs @@ -38,7 +38,7 @@ impl TimerFd { }) } - #[allow(clippy::await_holding_refcell_ref)] + #[expect(clippy::await_holding_refcell_ref)] pub async fn expired(&self, ring: &IoUring) -> Result { let mut buf = self.buf.borrow_mut(); if let Err(e) = ring.read(&self.fd, buf.buf()).await { diff --git a/src/utils/tri.rs b/src/utils/tri.rs index 56285a97..02d8cdb6 100644 --- a/src/utils/tri.rs +++ b/src/utils/tri.rs @@ -10,7 +10,7 @@ pub trait Try: Sized { where F: FnOnce() -> Result<(), Self>; - #[allow(dead_code)] + #[expect(dead_code)] fn tria(f: F) -> Tria where F: Future>; diff --git a/src/utils/vecset.rs b/src/utils/vecset.rs index 8351e3b8..9a7d6c97 100644 --- a/src/utils/vecset.rs +++ b/src/utils/vecset.rs @@ -19,7 +19,7 @@ impl Deref for VecSet { } impl VecSet { - #[allow(dead_code)] + #[expect(dead_code)] pub fn clear(&mut self) { self.vec.clear(); } diff --git a/src/utils/vecstorage.rs b/src/utils/vecstorage.rs index 2a3daa39..5b535850 100644 --- a/src/utils/vecstorage.rs +++ b/src/utils/vecstorage.rs @@ -19,7 +19,6 @@ impl Default for VecStorage { } impl VecStorage { - #[allow(dead_code)] pub fn take<'a>(&'a mut self) -> RealizedVec<'a, T, T> { self.take_as() } diff --git a/src/utils/windows.rs b/src/utils/windows.rs index 4128ef5c..8f225cfb 100644 --- a/src/utils/windows.rs +++ b/src/utils/windows.rs @@ -1,13 +1,12 @@ use crate::utils::ptr_ext::PtrExt; -#[cfg_attr(not(feature = "it"), allow(dead_code))] pub trait WindowsExt { type Windows<'a, const N: usize>: Iterator where Self: 'a, T: 'a; - #[cfg_attr(not(feature = "rc_tracking"), allow(dead_code))] + #[cfg_attr(not(feature = "rc_tracking"), expect(dead_code))] fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N>; fn array_chunks_ext<'a, const N: usize>(&'a self) -> &'a [[T; N]]; } diff --git a/src/video.rs b/src/video.rs index 3c4d318e..572190a1 100644 --- a/src/video.rs +++ b/src/video.rs @@ -5,5 +5,4 @@ pub mod gbm; pub type Modifier = u64; pub const INVALID_MODIFIER: Modifier = 0x00ff_ffff_ffff_ffff; -#[allow(dead_code)] pub const LINEAR_MODIFIER: Modifier = 0; diff --git a/src/video/dmabuf.rs b/src/video/dmabuf.rs index 4ef66a96..ff474cee 100644 --- a/src/video/dmabuf.rs +++ b/src/video/dmabuf.rs @@ -59,14 +59,12 @@ impl DmaBuf { const DMA_BUF_BASE: u64 = b'b' as _; -#[allow(non_camel_case_types)] #[repr(C)] struct dma_buf_export_sync_file { flags: u32, fd: i32, } -#[allow(non_camel_case_types)] #[repr(C)] struct dma_buf_import_sync_file { flags: u32, diff --git a/src/video/drm.rs b/src/video/drm.rs index 32c0a075..ceca8c77 100644 --- a/src/video/drm.rs +++ b/src/video/drm.rs @@ -313,7 +313,6 @@ impl DrmMaster { mode_get_resources(self.raw()) } - #[allow(dead_code)] pub fn get_cap(&self, cap: u64) -> Result { get_cap(self.raw(), cap) } @@ -525,7 +524,7 @@ impl DrmMaster { Ok(formats) } - #[allow(clippy::await_holding_refcell_ref)] + #[expect(clippy::await_holding_refcell_ref)] pub async fn event(&self) -> Result, DrmError> { if self.events.is_empty() { let mut buf = self.buf.borrow_mut(); @@ -851,7 +850,7 @@ pub struct ObjectChange<'a> { } impl Change { - #[allow(dead_code)] + #[expect(dead_code)] pub fn test(&self, flags: u32) -> Result<(), DrmError> { mode_atomic( self.master.raw(), @@ -914,7 +913,7 @@ impl Drop for Change { } } -#[allow(non_camel_case_types)] +#[expect(non_camel_case_types)] #[derive(Copy, Clone, Debug)] pub enum ConnectorType { Unknown(u32), @@ -968,7 +967,7 @@ impl ConnectorType { } } - #[allow(dead_code)] + #[expect(dead_code)] pub fn to_drm(self) -> u32 { match self { Self::Unknown(n) => n, diff --git a/src/video/drm/sync_obj.rs b/src/video/drm/sync_obj.rs index d1d74f6a..97de5b7a 100644 --- a/src/video/drm/sync_obj.rs +++ b/src/video/drm/sync_obj.rs @@ -54,7 +54,7 @@ impl SyncObj { } } - #[cfg_attr(not(feature = "it"), allow(dead_code))] + #[cfg_attr(not(feature = "it"), expect(dead_code))] pub fn fd(&self) -> &Rc { &self.fd } diff --git a/src/video/drm/sys.rs b/src/video/drm/sys.rs index 0688af40..556a8ef0 100644 --- a/src/video/drm/sys.rs +++ b/src/video/drm/sys.rs @@ -216,7 +216,7 @@ struct drm_mode_get_property { const DRM_IOCTL_MODE_GETPROPERTY: u64 = drm_iowr::(0xaa); -#[allow(dead_code)] +#[expect(dead_code)] const DRM_MODE_PROP_PENDING: u32 = 1 << 0; const DRM_MODE_PROP_RANGE: u32 = 1 << 1; const DRM_MODE_PROP_IMMUTABLE: u32 = 1 << 2; @@ -406,10 +406,9 @@ pub const DRM_MODE_OBJECT_PROPERTY: u32 = 0xb0b0b0b0; pub const DRM_MODE_OBJECT_FB: u32 = 0xfbfbfbfb; pub const DRM_MODE_OBJECT_BLOB: u32 = 0xbbbbbbbb; pub const DRM_MODE_OBJECT_PLANE: u32 = 0xeeeeeeee; -#[allow(dead_code)] +#[expect(dead_code)] pub const DRM_MODE_OBJECT_ANY: u32 = 0; -#[allow(dead_code)] pub const DRM_MODE_CONNECTOR_Unknown: u32 = 0; pub const DRM_MODE_CONNECTOR_VGA: u32 = 1; pub const DRM_MODE_CONNECTOR_DVII: u32 = 2; @@ -962,7 +961,7 @@ struct drm_mode_fb_cmd2 { modifiers: [u64; 4], } -#[allow(dead_code)] +#[expect(dead_code)] pub const DRM_MODE_FB_INTERLACED: u32 = 1 << 0; pub const DRM_MODE_FB_MODIFIERS: u32 = 1 << 1; @@ -1046,10 +1045,10 @@ pub fn gem_close(fd: c::c_int, handle: u32) -> Result<(), OsError> { Ok(()) } -#[allow(dead_code)] +#[expect(dead_code)] pub const DRM_EVENT_VBLANK: u32 = 0x01; pub const DRM_EVENT_FLIP_COMPLETE: u32 = 0x02; -#[allow(dead_code)] +#[expect(dead_code)] pub const DRM_EVENT_CRTC_SEQUENCE: u32 = 0x03; #[repr(C)] diff --git a/src/video/gbm.rs b/src/video/gbm.rs index 3be4fdd3..9a57c92a 100644 --- a/src/video/gbm.rs +++ b/src/video/gbm.rs @@ -52,27 +52,22 @@ pub type Device = u8; type Bo = u8; pub const GBM_BO_USE_SCANOUT: u32 = 1 << 0; -#[allow(dead_code)] pub const GBM_BO_USE_CURSOR: u32 = 1 << 1; pub const GBM_BO_USE_RENDERING: u32 = 1 << 2; -#[allow(dead_code)] pub const GBM_BO_USE_WRITE: u32 = 1 << 3; pub const GBM_BO_USE_LINEAR: u32 = 1 << 4; -#[allow(dead_code)] pub const GBM_BO_USE_PROTECTED: u32 = 1 << 5; -#[allow(dead_code)] +#[expect(dead_code)] const GBM_BO_IMPORT_WL_BUFFER: u32 = 0x5501; -#[allow(dead_code)] +#[expect(dead_code)] const GBM_BO_IMPORT_EGL_IMAGE: u32 = 0x5502; -#[allow(dead_code)] +#[expect(dead_code)] const GBM_BO_IMPORT_FD: u32 = 0x5503; const GBM_BO_IMPORT_FD_MODIFIER: u32 = 0x5504; const GBM_BO_TRANSFER_READ: u32 = 1 << 0; -#[allow(dead_code)] const GBM_BO_TRANSFER_WRITE: u32 = 1 << 1; -#[allow(dead_code)] const GBM_BO_TRANSFER_READ_WRITE: u32 = GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE; #[repr(C)] @@ -106,14 +101,14 @@ extern "C" { fn gbm_bo_get_plane_count(bo: *mut Bo) -> c::c_int; fn gbm_bo_get_width(bo: *mut Bo) -> u32; fn gbm_bo_get_height(bo: *mut Bo) -> u32; - #[allow(dead_code)] + #[expect(dead_code)] fn gbm_bo_get_stride(bo: *mut Bo) -> u32; fn gbm_bo_get_modifier(bo: *mut Bo) -> u64; fn gbm_bo_get_stride_for_plane(bo: *mut Bo, plane: c::c_int) -> u32; fn gbm_bo_get_fd_for_plane(bo: *mut Bo, plane: c::c_int) -> c::c_int; fn gbm_bo_get_offset(bo: *mut Bo, plane: c::c_int) -> u32; fn gbm_bo_get_format(bo: *mut Bo) -> u32; - #[allow(dead_code)] + #[expect(dead_code)] fn gbm_bo_get_bpp(bo: *mut Bo) -> u32; fn gbm_bo_map( bo: *mut Bo, diff --git a/src/wl_usr/usr_ifs/usr_jay_compositor.rs b/src/wl_usr/usr_ifs/usr_jay_compositor.rs index 7090d29d..6aaab0b3 100644 --- a/src/wl_usr/usr_ifs/usr_jay_compositor.rs +++ b/src/wl_usr/usr_ifs/usr_jay_compositor.rs @@ -96,7 +96,7 @@ impl UsrJayCompositor { jo } - #[allow(dead_code)] + #[expect(dead_code)] pub fn watch_workspaces(&self) -> Rc { let ww = Rc::new(UsrJayWorkspaceWatcher { id: self.con.id(), diff --git a/src/wl_usr/usr_ifs/usr_jay_screencast.rs b/src/wl_usr/usr_ifs/usr_jay_screencast.rs index db79b472..ad150315 100644 --- a/src/wl_usr/usr_ifs/usr_jay_screencast.rs +++ b/src/wl_usr/usr_ifs/usr_jay_screencast.rs @@ -88,7 +88,7 @@ impl UsrJayScreencast { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn touch_allowed_workspaces(&self) { self.con .request(TouchAllowedWorkspaces { self_id: self.id }); diff --git a/src/wl_usr/usr_ifs/usr_wl_pointer.rs b/src/wl_usr/usr_ifs/usr_wl_pointer.rs index 78851633..55153bd3 100644 --- a/src/wl_usr/usr_ifs/usr_wl_pointer.rs +++ b/src/wl_usr/usr_ifs/usr_wl_pointer.rs @@ -41,7 +41,7 @@ pub trait UsrWlPointerOwner { } impl UsrWlPointer { - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_cursor(&self, serial: u32, cursor: &UsrWlSurface, hot_x: i32, hot_y: i32) { self.con.request(SetCursor { self_id: self.id, diff --git a/src/wl_usr/usr_ifs/usr_wl_shm.rs b/src/wl_usr/usr_ifs/usr_wl_shm.rs index d608b39f..0218dd1a 100644 --- a/src/wl_usr/usr_ifs/usr_wl_shm.rs +++ b/src/wl_usr/usr_ifs/usr_wl_shm.rs @@ -18,7 +18,7 @@ pub struct UsrWlShm { } impl UsrWlShm { - #[allow(dead_code)] + #[expect(dead_code)] pub fn create_pool(&self, fd: &Rc, size: i32) -> Rc { let pool = Rc::new(UsrWlShmPool { id: self.con.id(), diff --git a/src/wl_usr/usr_ifs/usr_wl_shm_pool.rs b/src/wl_usr/usr_ifs/usr_wl_shm_pool.rs index 47ec5176..c436c04d 100644 --- a/src/wl_usr/usr_ifs/usr_wl_shm_pool.rs +++ b/src/wl_usr/usr_ifs/usr_wl_shm_pool.rs @@ -14,7 +14,7 @@ pub struct UsrWlShmPool { } impl UsrWlShmPool { - #[allow(dead_code)] + #[expect(dead_code)] pub fn resize(&self, size: i32) { self.con.request(Resize { self_id: self.id, diff --git a/src/wl_usr/usr_ifs/usr_wlr_layer_surface.rs b/src/wl_usr/usr_ifs/usr_wlr_layer_surface.rs index c5bdb125..e6871c38 100644 --- a/src/wl_usr/usr_ifs/usr_wlr_layer_surface.rs +++ b/src/wl_usr/usr_ifs/usr_wlr_layer_surface.rs @@ -32,7 +32,7 @@ impl UsrWlrLayerSurface { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_keyboard_interactivity(&self, ki: u32) { self.con.request(SetKeyboardInteractivity { self_id: self.id, @@ -40,7 +40,7 @@ impl UsrWlrLayerSurface { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_layer(&self, layer: u32) { self.con.request(SetLayer { self_id: self.id, diff --git a/src/wl_usr/usr_ifs/usr_wp_viewport.rs b/src/wl_usr/usr_ifs/usr_wp_viewport.rs index 22fda7ba..afd43283 100644 --- a/src/wl_usr/usr_ifs/usr_wp_viewport.rs +++ b/src/wl_usr/usr_ifs/usr_wp_viewport.rs @@ -15,7 +15,7 @@ pub struct UsrWpViewport { } impl UsrWpViewport { - #[allow(dead_code)] + #[expect(dead_code)] pub fn set_source(&self, x: Fixed, y: Fixed, width: Fixed, height: Fixed) { self.con.request(SetSource { self_id: self.id, diff --git a/src/wl_usr/usr_ifs/usr_zwlr_screencopy_frame.rs b/src/wl_usr/usr_ifs/usr_zwlr_screencopy_frame.rs index 329d0624..ca061c01 100644 --- a/src/wl_usr/usr_ifs/usr_zwlr_screencopy_frame.rs +++ b/src/wl_usr/usr_ifs/usr_zwlr_screencopy_frame.rs @@ -42,7 +42,7 @@ pub trait UsrZwlrScreencopyFrameOwner { } impl UsrZwlrScreencopyFrame { - #[allow(dead_code)] + #[expect(dead_code)] pub fn copy(&self, buffer: &UsrWlBuffer) { self.con.request(Copy { self_id: self.id, @@ -50,7 +50,7 @@ impl UsrZwlrScreencopyFrame { }); } - #[allow(dead_code)] + #[expect(dead_code)] pub fn copy_with_damage(&self, buffer: &UsrWlBuffer) { self.con.request(CopyWithDamage { self_id: self.id, diff --git a/src/wl_usr/usr_ifs/usr_zwlr_screencopy_manager.rs b/src/wl_usr/usr_ifs/usr_zwlr_screencopy_manager.rs index fe1228e3..2d608058 100644 --- a/src/wl_usr/usr_ifs/usr_zwlr_screencopy_manager.rs +++ b/src/wl_usr/usr_ifs/usr_zwlr_screencopy_manager.rs @@ -20,7 +20,7 @@ pub struct UsrZwlrScreencopyManager { } impl UsrZwlrScreencopyManager { - #[allow(dead_code)] + #[expect(dead_code)] pub fn capture_output(&self, output: &UsrWlOutput) -> Rc { let frame = Rc::new(UsrZwlrScreencopyFrame { id: self.con.id(), diff --git a/src/xcon/incoming.rs b/src/xcon/incoming.rs index 3315913f..747cd881 100644 --- a/src/xcon/incoming.rs +++ b/src/xcon/incoming.rs @@ -37,7 +37,7 @@ impl Incoming { } } - #[allow(clippy::await_holding_refcell_ref)] // false positive + #[expect(clippy::await_holding_refcell_ref)] // false positive async fn handle_msg(&mut self) -> Result<(), XconError> { const MAX_LENGTH_UNITS: usize = 0x4000 / 4; const MIN_MSG_SIZE: usize = 32; diff --git a/src/xkbcommon.rs b/src/xkbcommon.rs index bec32b9e..d4307c71 100644 --- a/src/xkbcommon.rs +++ b/src/xkbcommon.rs @@ -98,15 +98,12 @@ extern "C" { ) -> c::c_int; fn xkb_state_unref(state: *mut xkb_state); fn xkb_state_new(keymap: *mut xkb_keymap) -> *mut xkb_state; - #[allow(dead_code)] fn xkb_state_update_key( state: *mut xkb_state, key: u32, direction: xkb_key_direction, ) -> xkb_state_component; - #[allow(dead_code)] fn xkb_state_serialize_mods(state: *mut xkb_state, components: xkb_state_component) -> u32; - #[allow(dead_code)] fn xkb_state_serialize_layout(state: *mut xkb_state, components: xkb_state_component) -> u32; fn xkb_state_update_mask( state: *mut xkb_state, @@ -362,7 +359,7 @@ impl XkbState { *self = new_state; } - #[allow(dead_code)] + #[expect(dead_code)] pub fn set( &mut self, mods_depressed: u32, diff --git a/src/xwayland.rs b/src/xwayland.rs index bd2e1d6a..1bbd8d13 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -271,7 +271,7 @@ pub enum XWaylandEvent { Activate(Rc), ActivateRoot, Close(Rc), - #[allow(dead_code)] + #[expect(dead_code)] SeatChanged, IpcCancelSource { diff --git a/src/xwayland/xwm.rs b/src/xwayland/xwm.rs index da60f4b4..39335c7c 100644 --- a/src/xwayland/xwm.rs +++ b/src/xwayland/xwm.rs @@ -939,14 +939,14 @@ impl Wm { self.set_net_wm_state(data).await; } - #[allow(dead_code)] + #[expect(dead_code)] async fn set_maximized(&self, data: &Rc, maximized: bool) { data.info.maximized_vert.set(maximized); data.info.maximized_horz.set(maximized); self.set_net_wm_state(data).await; } - #[allow(dead_code)] + #[expect(dead_code)] async fn set_fullscreen(&self, data: &Rc, fullscreen: bool) { if false { // NOTE: We do not want to inform the program if the user changes the fullscreen diff --git a/toml-config/src/config/extractor.rs b/toml-config/src/config/extractor.rs index 194b3ea5..58c2d7d5 100644 --- a/toml-config/src/config/extractor.rs +++ b/toml-config/src/config/extractor.rs @@ -139,7 +139,6 @@ pub fn val( macro_rules! ty { ($f:ident, $lt:lifetime, $ty:ident, $ret:ty, $v:ident, $map:expr, $name:expr) => { - #[allow(dead_code)] pub fn $f( name: &'static str, ) -> impl for<$lt> FnOnce(&mut Extractor<$lt>) -> Result, Spanned> { @@ -158,7 +157,7 @@ ty!(int, 'a, Integer, i64, v, *v, "an integer"); ty!(flt, 'a, Float, f64, v, *v, "a float"); ty!(bol, 'a, Boolean, bool, v, *v, "a boolean"); ty!(arr, 'a, Array, &'a [Spanned], v, &**v, "an array"); -ty!(tbl, 'a, Table, &'a IndexMap, Spanned>, v, v, "a table"); +// ty!(tbl, 'a, Table, &'a IndexMap, Spanned>, v, v, "a table"); pub fn fltorint( name: &'static str, @@ -176,7 +175,6 @@ pub fn fltorint( macro_rules! int { ($f:ident, $ty:ident, $err:ident) => { - #[allow(dead_code)] pub fn $f( name: &'static str, ) -> impl for<'v> FnOnce(&mut Extractor<'v>) -> Result, Spanned> { @@ -254,7 +252,7 @@ macro_rules! tuples { { type Output = ($($name::Output,)*); - #[allow(non_snake_case)] + #[expect(non_snake_case)] fn extract(self, extractor: &mut Extractor<'v>) -> Result> { $( let $name = self.$idx.extract(extractor); diff --git a/toml-config/src/config/parser.rs b/toml-config/src/config/parser.rs index 68d7b913..53bc3e91 100644 --- a/toml-config/src/config/parser.rs +++ b/toml-config/src/config/parser.rs @@ -45,7 +45,7 @@ impl Display for DataTypes { 2 => write!(f, "{} or {}", d[0], d[1]), _ => { let mut first = true; - #[allow(clippy::needless_range_loop)] + #[expect(clippy::needless_range_loop)] for i in 0..d.len() - 1 { if !first { f.write_str(", ")?; diff --git a/toml-config/src/toml/toml_parser.rs b/toml-config/src/toml/toml_parser.rs index 878e6dce..56178448 100644 --- a/toml-config/src/toml/toml_parser.rs +++ b/toml-config/src/toml/toml_parser.rs @@ -442,7 +442,7 @@ impl<'a, 'b> Parser<'a, 'b> { } } - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn parse_key_value( &mut self, ) -> Result<(Key, Spanned), (Spanned, Option)> {