Skip to content

Commit

Permalink
virtio/queue: use inspect instead of map
Browse files Browse the repository at this point in the history
Use inspect() instead of map() to make clippy happy.

Signed-off-by: Sergio Lopez <[email protected]>
  • Loading branch information
slp committed Sep 11, 2024
1 parent 67f7577 commit f8e049c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/devices/src/virtio/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,8 @@ impl Queue {
.read_obj(self.avail_ring.unchecked_add(u64::from(index_offset)))
.unwrap();

DescriptorChain::checked_new(mem, self.desc_table, self.actual_size(), desc_index).map(
|dc| {
self.next_avail += Wrapping(1);
dc
},
)
DescriptorChain::checked_new(mem, self.desc_table, self.actual_size(), desc_index)
.inspect(|_| self.next_avail += Wrapping(1))
}

/// Undo the effects of the last `self.pop()` call.
Expand Down

0 comments on commit f8e049c

Please sign in to comment.