mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-28 16:29:45 +00:00
input: enable workspace-wide lints
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
parent
0915bba494
commit
522edf798e
@ -35,3 +35,6 @@ nix = { version = "0.30", features = ["ioctl"] }
|
||||
assert_matches = "1.5"
|
||||
virtio-queue = { version = "0.16", features = ["test-utils"] }
|
||||
vm-memory = { version = "0.16", features = ["backend-mmap", "backend-atomic"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@ -148,7 +148,9 @@ impl<T: InputDevice> VuInputBackend<T> {
|
||||
let last_sync_index = self
|
||||
.ev_list
|
||||
.iter()
|
||||
.rposition(|event| event.ev_type == EV_SYN as u16 && event.code == SYN_REPORT as u16)
|
||||
.rposition(|event| {
|
||||
event.ev_type == u16::from(EV_SYN) && event.code == u16::from(SYN_REPORT)
|
||||
})
|
||||
.unwrap_or(0);
|
||||
|
||||
if last_sync_index == 0 {
|
||||
@ -609,15 +611,15 @@ mod tests {
|
||||
.unwrap();
|
||||
|
||||
let ev_raw_data = VuInputEvent {
|
||||
ev_type: EV_KEY as u16,
|
||||
code: SYN_REPORT as u16,
|
||||
ev_type: u16::from(EV_KEY),
|
||||
code: u16::from(SYN_REPORT),
|
||||
value: 0,
|
||||
};
|
||||
backend.ev_list.push_back(ev_raw_data);
|
||||
|
||||
let ev_raw_data = VuInputEvent {
|
||||
ev_type: EV_SYN as u16,
|
||||
code: SYN_REPORT as u16,
|
||||
ev_type: u16::from(EV_SYN),
|
||||
code: u16::from(SYN_REPORT),
|
||||
value: 0,
|
||||
};
|
||||
backend.ev_list.push_back(ev_raw_data);
|
||||
@ -630,15 +632,15 @@ mod tests {
|
||||
assert_eq!(backend.ev_list.len(), 0);
|
||||
|
||||
let ev_raw_data = VuInputEvent {
|
||||
ev_type: EV_KEY as u16,
|
||||
code: SYN_REPORT as u16,
|
||||
ev_type: u16::from(EV_KEY),
|
||||
code: u16::from(SYN_REPORT),
|
||||
value: 0,
|
||||
};
|
||||
backend.ev_list.push_back(ev_raw_data);
|
||||
|
||||
let ev_raw_data = VuInputEvent {
|
||||
ev_type: EV_SYN as u16,
|
||||
code: SYN_REPORT as u16,
|
||||
ev_type: u16::from(EV_SYN),
|
||||
code: u16::from(SYN_REPORT),
|
||||
value: 0,
|
||||
};
|
||||
backend.ev_list.push_back(ev_raw_data);
|
||||
@ -854,7 +856,7 @@ mod tests {
|
||||
|
||||
assert_eq!(backend.queues_per_thread(), vec![0xffff_ffff]);
|
||||
assert_eq!(backend.get_config(0, 0), vec![]);
|
||||
assert!(backend.update_memory(mem.clone()).is_ok());
|
||||
backend.update_memory(mem.clone()).unwrap();
|
||||
|
||||
backend.set_event_idx(true);
|
||||
assert!(backend.event_idx);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user