From a962e43724f162132e52f4878f8a1dbb7ab7b2fb Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 20 Jan 2025 17:43:53 +0100 Subject: [PATCH] address clippy lints --- input-capture/src/libei.rs | 10 +++++----- input-emulation/src/libei.rs | 6 +++--- input-emulation/src/macos.rs | 2 +- input-emulation/src/xdg_desktop_portal.rs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/input-capture/src/libei.rs b/input-capture/src/libei.rs index ceb02b6..9edf764 100644 --- a/input-capture/src/libei.rs +++ b/input-capture/src/libei.rs @@ -153,7 +153,7 @@ async fn update_barriers( async fn create_session<'a>( input_capture: &'a InputCapture<'a>, -) -> std::result::Result<(Session<'_, InputCapture<'_>>, BitFlags), ashpd::Error> { +) -> std::result::Result<(Session<'a, InputCapture<'a>>, BitFlags), ashpd::Error> { log::debug!("creating input capture session"); input_capture .create_session( @@ -201,7 +201,7 @@ async fn libei_event_handler( } } -impl<'a> LibeiInputCapture<'a> { +impl LibeiInputCapture<'_> { pub async fn new() -> std::result::Result { let input_capture = Box::pin(InputCapture::new().await?); let input_capture_ptr = input_capture.as_ref().get_ref() as *const InputCapture<'static>; @@ -561,7 +561,7 @@ async fn handle_ei_event( } #[async_trait] -impl<'a> LanMouseInputCapture for LibeiInputCapture<'a> { +impl LanMouseInputCapture for LibeiInputCapture<'_> { async fn create(&mut self, pos: Position) -> Result<(), CaptureError> { let _ = self .notify_capture @@ -594,7 +594,7 @@ impl<'a> LanMouseInputCapture for LibeiInputCapture<'a> { } } -impl<'a> Drop for LibeiInputCapture<'a> { +impl Drop for LibeiInputCapture<'_> { fn drop(&mut self) { if !self.terminated { /* this workaround is needed until async drop is stabilized */ @@ -603,7 +603,7 @@ impl<'a> Drop for LibeiInputCapture<'a> { } } -impl<'a> Stream for LibeiInputCapture<'a> { +impl Stream for LibeiInputCapture<'_> { type Item = Result<(Position, CaptureEvent), CaptureError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { diff --git a/input-emulation/src/libei.rs b/input-emulation/src/libei.rs index d59cbf3..0ba0e5a 100644 --- a/input-emulation/src/libei.rs +++ b/input-emulation/src/libei.rs @@ -74,7 +74,7 @@ async fn get_ei_fd<'a>( Ok((remote_desktop, session, fd)) } -impl<'a> LibeiEmulation<'a> { +impl LibeiEmulation<'_> { pub(crate) async fn new() -> Result { let (_remote_desktop, session, eifd) = get_ei_fd().await?; let stream = UnixStream::from(eifd); @@ -109,14 +109,14 @@ impl<'a> LibeiEmulation<'a> { } } -impl<'a> Drop for LibeiEmulation<'a> { +impl Drop for LibeiEmulation<'_> { fn drop(&mut self) { self.ei_task.abort(); } } #[async_trait] -impl<'a> Emulation for LibeiEmulation<'a> { +impl Emulation for LibeiEmulation<'_> { async fn consume( &mut self, event: Event, diff --git a/input-emulation/src/macos.rs b/input-emulation/src/macos.rs index d3f53b8..5ad6c53 100644 --- a/input-emulation/src/macos.rs +++ b/input-emulation/src/macos.rs @@ -170,7 +170,7 @@ fn get_display_at_point(x: CGFloat, y: CGFloat) -> Option { return Option::None; } - return displays.first().copied(); + displays.first().copied() } fn get_display_bounds(display: CGDirectDisplayID) -> (CGFloat, CGFloat, CGFloat, CGFloat) { diff --git a/input-emulation/src/xdg_desktop_portal.rs b/input-emulation/src/xdg_desktop_portal.rs index b14454d..4bf379b 100644 --- a/input-emulation/src/xdg_desktop_portal.rs +++ b/input-emulation/src/xdg_desktop_portal.rs @@ -52,7 +52,7 @@ impl<'a> DesktopPortalEmulation<'a> { } #[async_trait] -impl<'a> Emulation for DesktopPortalEmulation<'a> { +impl Emulation for DesktopPortalEmulation<'_> { async fn consume( &mut self, event: input_event::Event, @@ -141,7 +141,7 @@ impl<'a> Emulation for DesktopPortalEmulation<'a> { } } -impl<'a> AsyncDrop for DesktopPortalEmulation<'a> { +impl AsyncDrop for DesktopPortalEmulation<'_> { #[doc = r" Perform the async cleanup."] #[must_use] #[allow(clippy::type_complexity, clippy::type_repetition_in_bounds)]