mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 20:19:07 +00:00
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>
This commit is contained in:
parent
d8d9556184
commit
fcf078c38a
1 changed files with 1 additions and 1 deletions
|
@ -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)?;
|
||||
|
|
Loading…
Reference in a new issue