Skip to content

Commit

Permalink
virtio-devices: Fix beta clippy issue
Browse files Browse the repository at this point in the history
error: use of a fallible conversion when an infallible one could be used
Error:    --> virtio-devices/src/vhost_user/vu_common_ctrl.rs:206:51
    |
206 |             let actual_size: usize = queue.size().try_into().unwrap();
    |                                                   ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
    = note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`

error: could not compile `virtio-devices` (lib) due to previous error
Error: warning: build failed, waiting for other jobs to finish...
error: could not compile `virtio-devices` (lib test) due to previous error
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

Signed-off-by: Bo Chen <[email protected]>
  • Loading branch information
likebreath committed Nov 13, 2023
1 parent 3da5e8c commit 5f7a5bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions virtio-devices/src/vhost_user/vu_common_ctrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::{
get_host_address_range, GuestMemoryMmap, GuestRegionMmap, MmapRegion, VirtioInterrupt,
VirtioInterruptType,
};
use std::convert::TryInto;
use std::ffi;
use std::fs::File;
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
Expand Down Expand Up @@ -203,7 +202,7 @@ impl VhostUserHandle {

let mut vrings_info = Vec::new();
for (queue_index, queue, queue_evt) in queues.iter() {
let actual_size: usize = queue.size().try_into().unwrap();
let actual_size: usize = queue.size().into();

let config_data = VringConfigData {
queue_max_size: queue.max_size(),
Expand Down

0 comments on commit 5f7a5bb

Please sign in to comment.