From 44eca3164244ebdf68a1a191c33782c2fde5c7a4 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 30 Jun 2022 16:41:46 +0100 Subject: [PATCH] build: Fix beta clippy issue (needless_return) warning: accessing first element with `data.get(0)` --> virtio-devices/src/transport/pci_device.rs:1055:34 | 1055 | if let Some(v) = data.get(0) { | ^^^^^^^^^^^ help: try: `data.first()` | = note: `#[warn(clippy::get_first)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first Signed-off-by: Rob Bradford --- virtio-devices/src/transport/pci_device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtio-devices/src/transport/pci_device.rs b/virtio-devices/src/transport/pci_device.rs index 76062c14e..b42a86ba0 100644 --- a/virtio-devices/src/transport/pci_device.rs +++ b/virtio-devices/src/transport/pci_device.rs @@ -1052,7 +1052,7 @@ impl PciDevice for VirtioPciDevice { self.device.clone(), ), o if (ISR_CONFIG_BAR_OFFSET..ISR_CONFIG_BAR_OFFSET + ISR_CONFIG_SIZE).contains(&o) => { - if let Some(v) = data.get(0) { + if let Some(v) = data.first() { self.interrupt_status .fetch_and(!(*v as usize), Ordering::AcqRel); }