diff --git a/crates/vsock/src/vhu_vsock_thread.rs b/crates/vsock/src/vhu_vsock_thread.rs index 37e50b7bf..30494b84d 100644 --- a/crates/vsock/src/vhu_vsock_thread.rs +++ b/crates/vsock/src/vhu_vsock_thread.rs @@ -453,11 +453,11 @@ impl VhostUserVsockThread { let queue = vring_mut.get_queue_mut(); - let mut queue_iter = queue + let queue_iter = queue .iter(atomic_mem.memory()) .map_err(|_| Error::IterateQueue)?; - while let Some(mut avail_desc) = queue_iter.next() { + for mut avail_desc in queue_iter { used_any = true; let mem = atomic_mem.clone().memory(); @@ -611,11 +611,11 @@ impl VhostUserVsockThread { let queue = vring_mut.get_queue_mut(); - let mut queue_iter = queue + let queue_iter = queue .iter(atomic_mem.memory()) .map_err(|_| Error::IterateQueue)?; - while let Some(mut avail_desc) = queue_iter.next() { + for mut avail_desc in queue_iter { used_any = true; let mem = atomic_mem.clone().memory();