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
This commit is contained in:
Jeremy Whiting 2025-07-02 15:26:11 -06:00
parent 35c90bf55a
commit 943cf70dbb
2 changed files with 5 additions and 2 deletions

View file

@ -177,9 +177,12 @@ pub(crate) enum SysfsWritten {
Superseded,
}
type SysfsQueue = (Vec<u8>, oneshot::Sender<SysfsWritten>);
type SysfsQueueMap = HashMap<PathBuf, SysfsQueue>;
#[derive(Debug)]
struct SysfsWriterQueue {
values: Mutex<HashMap<PathBuf, (Vec<u8>, oneshot::Sender<SysfsWritten>)>>,
values: Mutex<SysfsQueueMap>,
notify: Notify,
}

View file

@ -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)?;
}