address clippy lints

This commit is contained in:
Ferdinand Schober
2025-01-20 17:43:53 +01:00
committed by Ferdinand Schober
parent a8504df879
commit a962e43724
4 changed files with 11 additions and 11 deletions

View File

@@ -153,7 +153,7 @@ async fn update_barriers(
async fn create_session<'a>( async fn create_session<'a>(
input_capture: &'a InputCapture<'a>, input_capture: &'a InputCapture<'a>,
) -> std::result::Result<(Session<'_, InputCapture<'_>>, BitFlags<Capabilities>), ashpd::Error> { ) -> std::result::Result<(Session<'a, InputCapture<'a>>, BitFlags<Capabilities>), ashpd::Error> {
log::debug!("creating input capture session"); log::debug!("creating input capture session");
input_capture input_capture
.create_session( .create_session(
@@ -201,7 +201,7 @@ async fn libei_event_handler(
} }
} }
impl<'a> LibeiInputCapture<'a> { impl LibeiInputCapture<'_> {
pub async fn new() -> std::result::Result<Self, LibeiCaptureCreationError> { pub async fn new() -> std::result::Result<Self, LibeiCaptureCreationError> {
let input_capture = Box::pin(InputCapture::new().await?); let input_capture = Box::pin(InputCapture::new().await?);
let input_capture_ptr = input_capture.as_ref().get_ref() as *const InputCapture<'static>; 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] #[async_trait]
impl<'a> LanMouseInputCapture for LibeiInputCapture<'a> { impl LanMouseInputCapture for LibeiInputCapture<'_> {
async fn create(&mut self, pos: Position) -> Result<(), CaptureError> { async fn create(&mut self, pos: Position) -> Result<(), CaptureError> {
let _ = self let _ = self
.notify_capture .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) { fn drop(&mut self) {
if !self.terminated { if !self.terminated {
/* this workaround is needed until async drop is stabilized */ /* 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>; type Item = Result<(Position, CaptureEvent), CaptureError>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

View File

@@ -74,7 +74,7 @@ async fn get_ei_fd<'a>(
Ok((remote_desktop, session, fd)) Ok((remote_desktop, session, fd))
} }
impl<'a> LibeiEmulation<'a> { impl LibeiEmulation<'_> {
pub(crate) async fn new() -> Result<Self, LibeiEmulationCreationError> { pub(crate) async fn new() -> Result<Self, LibeiEmulationCreationError> {
let (_remote_desktop, session, eifd) = get_ei_fd().await?; let (_remote_desktop, session, eifd) = get_ei_fd().await?;
let stream = UnixStream::from(eifd); 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) { fn drop(&mut self) {
self.ei_task.abort(); self.ei_task.abort();
} }
} }
#[async_trait] #[async_trait]
impl<'a> Emulation for LibeiEmulation<'a> { impl Emulation for LibeiEmulation<'_> {
async fn consume( async fn consume(
&mut self, &mut self,
event: Event, event: Event,

View File

@@ -170,7 +170,7 @@ fn get_display_at_point(x: CGFloat, y: CGFloat) -> Option<CGDirectDisplayID> {
return Option::None; return Option::None;
} }
return displays.first().copied(); displays.first().copied()
} }
fn get_display_bounds(display: CGDirectDisplayID) -> (CGFloat, CGFloat, CGFloat, CGFloat) { fn get_display_bounds(display: CGDirectDisplayID) -> (CGFloat, CGFloat, CGFloat, CGFloat) {

View File

@@ -52,7 +52,7 @@ impl<'a> DesktopPortalEmulation<'a> {
} }
#[async_trait] #[async_trait]
impl<'a> Emulation for DesktopPortalEmulation<'a> { impl Emulation for DesktopPortalEmulation<'_> {
async fn consume( async fn consume(
&mut self, &mut self,
event: input_event::Event, 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."] #[doc = r" Perform the async cleanup."]
#[must_use] #[must_use]
#[allow(clippy::type_complexity, clippy::type_repetition_in_bounds)] #[allow(clippy::type_complexity, clippy::type_repetition_in_bounds)]