summary refs log tree commit diff
path: root/devices/src/virtio/virtio_pci_device.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-15 16:58:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-18 19:51:01 -0700
commitdc4effa72b214bc3bd14ca2f7772ab1b728aef5b (patch)
tree61c308a8c165a6fbe65f947da4abd241a9dd265d /devices/src/virtio/virtio_pci_device.rs
parent64cd5eae5778b86f6e498a6fa1b1962693aa5a46 (diff)
downloadcrosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar.gz
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar.bz2
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar.lz
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar.xz
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.tar.zst
crosvm-dc4effa72b214bc3bd14ca2f7772ab1b728aef5b.zip
clippy: Iterate without calling .iter()
See:
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop

Before:

    for element in slice.iter() {...}

After:

    for element in slice {...}

TEST=grep -r '\.iter() {'
TEST=grep -r '\.iter_mut() {'
TEST=grep -r '\.into_iter() {'
TEST=cargo check --all-features
TEST=local kokoro

Change-Id: I27f0df7cfa1064b2c8b162cba263513926a433a9
Reviewed-on: https://chromium-review.googlesource.com/1568525
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src/virtio/virtio_pci_device.rs')
-rw-r--r--devices/src/virtio/virtio_pci_device.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs
index 337b7bb..5b54de5 100644
--- a/devices/src/virtio/virtio_pci_device.rs
+++ b/devices/src/virtio/virtio_pci_device.rs
@@ -167,7 +167,7 @@ impl VirtioPciDevice {
     /// Constructs a new PCI transport for the given virtio device.
     pub fn new(mem: GuestMemory, device: Box<dyn VirtioDevice>) -> Result<Self> {
         let mut queue_evts = Vec::new();
-        for _ in device.queue_max_sizes().iter() {
+        for _ in device.queue_max_sizes() {
             queue_evts.push(EventFd::new()?)
         }
         let queues = device