diff --git a/jay-config/src/_private.rs b/jay-config/src/_private.rs index 62715732..45034dd0 100644 --- a/jay-config/src/_private.rs +++ b/jay-config/src/_private.rs @@ -1,7 +1,6 @@ pub mod client; pub mod ipc; mod logging; -pub(crate) mod string_error; use { crate::{ diff --git a/jay-config/src/_private/string_error.rs b/jay-config/src/_private/string_error.rs deleted file mode 100644 index 9b8cfcf7..00000000 --- a/jay-config/src/_private/string_error.rs +++ /dev/null @@ -1,15 +0,0 @@ -use std::{ - error::Error, - fmt::{Display, Formatter}, -}; - -#[derive(Debug)] -pub struct StringError(pub String); - -impl Display for StringError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.write_str(&self.0) - } -} - -impl Error for StringError {} diff --git a/src/client.rs b/src/client.rs index f7f46712..0eab34b4 100644 --- a/src/client.rs +++ b/src/client.rs @@ -466,7 +466,7 @@ impl Client { self.checking_queue_size.set(false); } - pub fn lock_registries(&self) -> Locked> { + pub fn lock_registries(&self) -> Locked<'_, WlRegistryId, Rc> { self.objects.registries() } diff --git a/src/client/objects.rs b/src/client/objects.rs index c378e5e5..1b489ac9 100644 --- a/src/client/objects.rs +++ b/src/client/objects.rs @@ -256,7 +256,7 @@ impl Objects { Ok(()) } - pub fn registries(&self) -> Locked> { + pub fn registries(&self) -> Locked<'_, WlRegistryId, Rc> { self.registries.lock() } diff --git a/src/criteria/crit_graph/crit_upstream.rs b/src/criteria/crit_graph/crit_upstream.rs index df799075..096a5555 100644 --- a/src/criteria/crit_graph/crit_upstream.rs +++ b/src/criteria/crit_graph/crit_upstream.rs @@ -151,7 +151,7 @@ where } } - pub fn get_or_create(&self, target: &Target) -> RefMut> + pub fn get_or_create(&self, target: &Target) -> RefMut<'_, CritUpstreamNodeData> where T: Default, { @@ -162,7 +162,7 @@ where }) } - pub fn get(&self, target: &Target) -> Option>> { + pub fn get(&self, target: &Target) -> Option>> { self.nodes.get(target) } diff --git a/src/criteria/crit_leaf.rs b/src/criteria/crit_leaf.rs index 67051ebe..72b74ccd 100644 --- a/src/criteria/crit_leaf.rs +++ b/src/criteria/crit_leaf.rs @@ -10,6 +10,7 @@ use { std::{ cell::Cell, rc::{Rc, Weak}, + slice, }, }; @@ -86,7 +87,7 @@ where targets: CritPerTargetData::new(slf, id), on_match: Box::new(on_match), events: mgr.leaf_events().clone(), - upstream: CritDownstreamData::new(id, &[upstream.clone()]), + upstream: CritDownstreamData::new(id, slice::from_ref(upstream)), }); slf.upstream.attach(&slf); slf diff --git a/src/criteria/crit_per_target_data.rs b/src/criteria/crit_per_target_data.rs index d675513c..cf527167 100644 --- a/src/criteria/crit_per_target_data.rs +++ b/src/criteria/crit_per_target_data.rs @@ -60,7 +60,7 @@ where self.data.borrow_mut().clear(); } - pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut { + pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<'_, T> { RefMut::map(self.data.borrow_mut(), |d| { &mut d .entry(target.id()) @@ -75,7 +75,7 @@ where }) } - pub fn get(&self, target: &Target) -> Option> { + pub fn get(&self, target: &Target) -> Option> { RefMut::filter_map(self.data.borrow_mut(), |d| { d.get_mut(&target.id()).map(|d| &mut d.data) }) diff --git a/src/criteria/tlm/tlm_matchers/tlmm_client.rs b/src/criteria/tlm/tlm_matchers/tlmm_client.rs index 3fa9a3c0..13fd3a5c 100644 --- a/src/criteria/tlm/tlm_matchers/tlmm_client.rs +++ b/src/criteria/tlm/tlm_matchers/tlmm_client.rs @@ -14,7 +14,7 @@ use { state::State, tree::{ToplevelData, ToplevelNodeBase}, }, - std::rc::Rc, + std::{rc::Rc, slice}, }; pub struct TlmMatchClient { @@ -32,7 +32,7 @@ impl TlmMatchClient { id, state: state.clone(), node: node.clone(), - upstream: CritDownstreamData::new(id, &[node.clone()]), + upstream: CritDownstreamData::new(id, slice::from_ref(node)), downstream: CritUpstreamData::new(slf, id), }); slf.upstream.attach(&slf); diff --git a/src/dbus.rs b/src/dbus.rs index 39094c3b..768fc678 100644 --- a/src/dbus.rs +++ b/src/dbus.rs @@ -481,6 +481,7 @@ pub unsafe trait DbusType<'a>: Clone + 'a { type Generic<'b>: DbusType<'b> + 'b; fn consume_signature(s: &mut &[u8]) -> Result<(), DbusError>; + #[expect(dead_code)] fn write_signature(w: &mut Vec); fn marshal(&self, fmt: &mut Formatter); fn unmarshal(parser: &mut Parser<'a>) -> Result; diff --git a/src/gfx_apis/vulkan/allocator.rs b/src/gfx_apis/vulkan/allocator.rs index ab8c55c0..bff766b3 100644 --- a/src/gfx_apis/vulkan/allocator.rs +++ b/src/gfx_apis/vulkan/allocator.rs @@ -101,7 +101,7 @@ impl VulkanAllocation { Ok(f(self.mem.unwrap(), self.size as usize)) } - fn incoherent_range(&self, mask: u64) -> MappedMemoryRange { + fn incoherent_range(&self, mask: u64) -> MappedMemoryRange<'static> { MappedMemoryRange::default() .memory(self.memory) .offset(self.offset & !mask) diff --git a/src/gfx_apis/vulkan/bo_allocator.rs b/src/gfx_apis/vulkan/bo_allocator.rs index 95936cbc..6a6946f8 100644 --- a/src/gfx_apis/vulkan/bo_allocator.rs +++ b/src/gfx_apis/vulkan/bo_allocator.rs @@ -751,7 +751,7 @@ fn image_create_info( height: u32, format: &Format, usage: BufferUsage, -) -> ImageCreateInfo { +) -> ImageCreateInfo<'_> { let usage = map_usage(usage); ImageCreateInfo::default() .image_type(ImageType::TYPE_2D) diff --git a/src/globals.rs b/src/globals.rs index 9de63369..43f4848d 100644 --- a/src/globals.rs +++ b/src/globals.rs @@ -299,7 +299,7 @@ impl Globals { Ok(()) } - pub fn lock_seats(&self) -> Locked> { + pub fn lock_seats(&self) -> Locked<'_, GlobalName, Rc> { self.seats.lock() } diff --git a/src/ifs/wl_callback.rs b/src/ifs/wl_callback.rs index 8bdfa948..411ab246 100644 --- a/src/ifs/wl_callback.rs +++ b/src/ifs/wl_callback.rs @@ -6,7 +6,6 @@ use { wire::{WlCallbackId, wl_callback::*}, }, std::{convert::Infallible, rc::Rc}, - thiserror::Error, }; pub struct WlCallback { @@ -44,6 +43,3 @@ object_base! { impl Object for WlCallback {} simple_add_obj!(WlCallback); - -#[derive(Debug, Error)] -pub enum WlCallbackError {} diff --git a/src/ifs/wl_surface/xdg_surface.rs b/src/ifs/wl_surface/xdg_surface.rs index 06ea59ef..d28e298d 100644 --- a/src/ifs/wl_surface/xdg_surface.rs +++ b/src/ifs/wl_surface/xdg_surface.rs @@ -371,7 +371,7 @@ impl XdgSurface { Ok(()) } - fn pending(&self) -> RefMut> { + fn pending(&self) -> RefMut<'_, Box> { RefMut::map(self.surface.pending.borrow_mut(), |p| { p.xdg_surface.get_or_insert_default_ext() }) diff --git a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs index 1a80770e..f1316bb6 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs @@ -36,7 +36,6 @@ use { }, ahash::{AHashMap, AHashSet}, jay_config::window::TileState, - num_derive::FromPrimitive, std::{ cell::{Cell, RefCell}, fmt::{Debug, Formatter}, @@ -46,19 +45,6 @@ use { thiserror::Error, }; -#[derive(Copy, Clone, Debug, FromPrimitive)] -pub enum ResizeEdge { - None = 0, - Top = 1, - Bottom = 2, - Left = 4, - TopLeft = 5, - BottomLeft = 6, - Right = 8, - TopRight = 9, - BottomRight = 10, -} - #[expect(dead_code)] const STATE_MAXIMIZED: u32 = 1; const STATE_FULLSCREEN: u32 = 2; diff --git a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs index feb22227..f6cf5dda 100644 --- a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs +++ b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs @@ -208,7 +208,7 @@ impl ZwlrLayerSurfaceV1 { self.client.event(Closed { self_id: self.id }); } - fn pending(&self) -> RefMut> { + fn pending(&self) -> RefMut<'_, Box> { RefMut::map(self.surface.pending.borrow_mut(), |m| { m.layer_surface.get_or_insert_default_ext() }) diff --git a/src/ifs/wp_presentation_feedback.rs b/src/ifs/wp_presentation_feedback.rs index 245ae8e6..57cdbd15 100644 --- a/src/ifs/wp_presentation_feedback.rs +++ b/src/ifs/wp_presentation_feedback.rs @@ -7,7 +7,6 @@ use { wire::{WpPresentationFeedbackId, wp_presentation_feedback::*}, }, std::{convert::Infallible, rc::Rc}, - thiserror::Error, }; pub struct WpPresentationFeedback { @@ -62,6 +61,3 @@ object_base! { impl Object for WpPresentationFeedback {} simple_add_obj!(WpPresentationFeedback); - -#[derive(Debug, Error)] -pub enum WpPresentationFeedbackError {} diff --git a/src/io_uring.rs b/src/io_uring.rs index eef3933b..97c86f66 100644 --- a/src/io_uring.rs +++ b/src/io_uring.rs @@ -459,7 +459,7 @@ impl IoUringData { encoded as usize } - fn id(&self) -> Cancellable { + fn id(&self) -> Cancellable<'_> { Cancellable { id: self.id_raw(), data: self, diff --git a/src/libinput.rs b/src/libinput.rs index 30e0d5e6..802843b1 100644 --- a/src/libinput.rs +++ b/src/libinput.rs @@ -147,7 +147,7 @@ impl LibInput { } } - pub fn event(&self) -> Option { + pub fn event(&self) -> Option> { let res = unsafe { libinput_get_event(self.li) }; if res.is_null() { None diff --git a/src/libinput/device.rs b/src/libinput/device.rs index ead512c2..75ccc2d9 100644 --- a/src/libinput/device.rs +++ b/src/libinput/device.rs @@ -391,7 +391,7 @@ impl<'a> LibInputTabletPadModeGroup<'a> { } impl RegisteredDevice { - pub fn device(&self) -> LibInputDevice { + pub fn device(&self) -> LibInputDevice<'_> { LibInputDevice { dev: self.dev, _phantom: Default::default(), diff --git a/src/libinput/event.rs b/src/libinput/event.rs index ed8b362b..c296c56f 100644 --- a/src/libinput/event.rs +++ b/src/libinput/event.rs @@ -110,7 +110,7 @@ impl<'a> Drop for LibInputEvent<'a> { macro_rules! converter { ($name:ident, $out:ident, $f:ident) => { - pub fn $name(&self) -> Option<$out> { + pub fn $name(&self) -> Option<$out<'_>> { let res = unsafe { $f(self.event) }; if res.is_null() { None @@ -129,7 +129,7 @@ impl<'a> LibInputEvent<'a> { unsafe { EventType(libinput_event_get_type(self.event)) } } - pub fn device(&self) -> LibInputDevice { + pub fn device(&self) -> LibInputDevice<'_> { LibInputDevice { dev: unsafe { libinput_event_get_device(self.event) }, _phantom: Default::default(), @@ -491,7 +491,7 @@ impl<'a> LibInputEventTabletPad<'a> { unsafe { libinput_event_tablet_pad_get_mode(self.event) as u32 } } - pub fn mode_group(&self) -> LibInputTabletPadModeGroup { + pub fn mode_group(&self) -> LibInputTabletPadModeGroup<'_> { LibInputTabletPadModeGroup { group: unsafe { libinput_event_tablet_pad_get_mode_group(self.event) }, _phantom: Default::default(), diff --git a/src/pipewire/pw_parser.rs b/src/pipewire/pw_parser.rs index b0f1d57c..08140be5 100644 --- a/src/pipewire/pw_parser.rs +++ b/src/pipewire/pw_parser.rs @@ -114,7 +114,7 @@ impl<'a> PwParser<'a> { } } - pub fn read_object_opt(&mut self) -> Result, PwParserError> { + pub fn read_object_opt(&mut self) -> Result>, PwParserError> { match self.read_pod()? { PwPod::Object(p) => Ok(Some(p)), PwPod::None => Ok(None), @@ -122,7 +122,7 @@ impl<'a> PwParser<'a> { } } - pub fn read_object(&mut self) -> Result { + pub fn read_object(&mut self) -> Result, PwParserError> { match self.read_object_opt()? { Some(p) => Ok(p), _ => Err(PwParserError::UnexpectedPodType( diff --git a/src/udev.rs b/src/udev.rs index c2034d59..45bdbbc5 100644 --- a/src/udev.rs +++ b/src/udev.rs @@ -281,7 +281,7 @@ impl UdevEnumerate { } } - pub fn get_list_entry(&mut self) -> Result, UdevError> { + pub fn get_list_entry(&mut self) -> Result>, UdevError> { let res = unsafe { udev_enumerate_get_list_entry(self.enumerate) }; if res.is_null() { let err = Errno::default(); diff --git a/src/utils/asyncevent.rs b/src/utils/asyncevent.rs index a1c384aa..c575f630 100644 --- a/src/utils/asyncevent.rs +++ b/src/utils/asyncevent.rs @@ -37,7 +37,7 @@ impl AsyncEvent { } } - pub fn triggered(&self) -> AsyncEventTriggered { + pub fn triggered(&self) -> AsyncEventTriggered<'_> { AsyncEventTriggered { ae: self } } } diff --git a/src/utils/bindings.rs b/src/utils/bindings.rs index 899246ae..36598286 100644 --- a/src/utils/bindings.rs +++ b/src/utils/bindings.rs @@ -38,7 +38,7 @@ impl Bindings

{ self.bindings.clear(); } - pub fn lock(&self) -> Locked<(ClientId, ObjectId), Rc

> { + pub fn lock(&self) -> Locked<'_, (ClientId, ObjectId), Rc

> { self.bindings.lock() } } @@ -89,7 +89,7 @@ impl PerClientBindings

{ } } - pub fn borrow(&self) -> Ref>>> { + pub fn borrow(&self) -> Ref<'_, AHashMap>>> { self.bindings.borrow() } } diff --git a/src/utils/log_on_drop.rs b/src/utils/log_on_drop.rs index ea3abfac..204a82b8 100644 --- a/src/utils/log_on_drop.rs +++ b/src/utils/log_on_drop.rs @@ -1,3 +1,4 @@ +#[expect(dead_code)] pub struct LogOnDrop(pub &'static str); impl Drop for LogOnDrop { diff --git a/src/utils/refcounted.rs b/src/utils/refcounted.rs index fd3dbb2c..a5d6fef1 100644 --- a/src/utils/refcounted.rs +++ b/src/utils/refcounted.rs @@ -58,7 +58,7 @@ impl RefCounted { unsafe { self.map.get().deref().iter().map(|k| k.0).collect() } } - pub fn lock(&self) -> Locked { + pub fn lock(&self) -> Locked<'_, T> { unsafe { Locked { vec: mem::take(self.map.get().deref_mut()), diff --git a/src/video/drm.rs b/src/video/drm.rs index b3734001..ad4a87ae 100644 --- a/src/video/drm.rs +++ b/src/video/drm.rs @@ -802,6 +802,7 @@ pub struct DrmVersion { pub desc: BString, } +#[expect(dead_code)] #[derive(Debug, Clone, Eq, PartialEq)] pub struct HdrMetadata { pub eotf: u8, diff --git a/wire-dbus/org.freedesktop.login1.Manager.txt b/wire-dbus/org.freedesktop.login1.Manager.txt index aa70fd14..ab4020fc 100644 --- a/wire-dbus/org.freedesktop.login1.Manager.txt +++ b/wire-dbus/org.freedesktop.login1.Manager.txt @@ -3,6 +3,3 @@ fn GetSession( ) { object_path: object_path, } - -prop BootLoaderEntries = array(string) -prop ScheduledShutdown = struct(string, u64)