summary refs log tree commit diff
path: root/disk/src
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-04-15 12:38:38 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-18 12:01:29 +0000
commitfcf078c38ad0bfdff17370108833833944b9c14c (patch)
tree9b9436e3e536b1596af35759ef266684c083272d /disk/src
parentd8d9556184d1eb84879045283b2b1a68f1b56fd2 (diff)
downloadcrosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar.gz
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar.bz2
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar.lz
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar.xz
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.tar.zst
crosvm-fcf078c38ad0bfdff17370108833833944b9c14c.zip
disk: resolve iter_nth_zero clippy warning
Replace .nth(0) with .next() to resolve this:

  error: called `.nth(0)` on a `std::iter::Iterator`

BUG=None
TEST=bin/clippy

Change-Id: I103e8b44b1564708d92d096aaf044db7f67d1ba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2151147
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Diffstat (limited to 'disk/src')
-rw-r--r--disk/src/qcow/vec_cache.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/disk/src/qcow/vec_cache.rs b/disk/src/qcow/vec_cache.rs
index ecd7673..18cfc69 100644
--- a/disk/src/qcow/vec_cache.rs
+++ b/disk/src/qcow/vec_cache.rs
@@ -120,7 +120,7 @@ impl<T: Cacheable> CacheMap<T> {
     {
         if self.map.len() == self.capacity {
             // TODO(dgreid) - smarter eviction strategy.
-            let to_evict = *self.map.iter().nth(0).unwrap().0;
+            let to_evict = *self.map.iter().next().unwrap().0;
             if let Some(evicted) = self.map.remove(&to_evict) {
                 if evicted.dirty() {
                     write_callback(to_evict, evicted)?;