Skip to content

Commit

Permalink
vsock: Replace while let with for to fit in clippy demands.
Browse files Browse the repository at this point in the history
clippy complains about the while let loop, so we change it to for loop
to fit in the demands.

Signed-off-by: Li Zebin <[email protected]>
  • Loading branch information
cutelizebin committed Aug 2, 2023
1 parent 00297f8 commit 698cd1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/vsock/src/vhu_vsock_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 698cd1c

Please sign in to comment.