From 943cf70dbb4556f5e60a5189be5febc55c6806a5 Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Wed, 2 Jul 2025 15:26:11 -0600 Subject: [PATCH] Fix a couple of clippy warnings. Use .iter instead of .into_iter in uinput.rs Use type definitions to fix some complexity in power.rs. See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity --- src/power.rs | 5 ++++- src/uinput.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/power.rs b/src/power.rs index a5257f3..b596e24 100644 --- a/src/power.rs +++ b/src/power.rs @@ -177,9 +177,12 @@ pub(crate) enum SysfsWritten { Superseded, } +type SysfsQueue = (Vec, oneshot::Sender); +type SysfsQueueMap = HashMap; + #[derive(Debug)] struct SysfsWriterQueue { - values: Mutex, oneshot::Sender)>>, + values: Mutex, notify: Notify, } diff --git a/src/uinput.rs b/src/uinput.rs index 5b03828..ec14765 100644 --- a/src/uinput.rs +++ b/src/uinput.rs @@ -76,7 +76,7 @@ impl UInputDevice { ensure!(!self.open, "Cannot reopen uinput handle"); self.handle.set_evbit(EventKind::Key)?; - for key in keybits.into_iter().copied() { + for key in keybits.iter().copied() { self.handle.set_keybit(key)?; }