From 9ff42060e04202281024bec5f59b734732c2a985 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 30 Sep 2019 10:17:01 -0700 Subject: [PATCH] vhost_user_backend: Fix clippy issues Signed-off-by: Sebastien Boeuf --- vhost_user_backend/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index eae8107d0..3889245b2 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -74,7 +74,7 @@ pub trait VhostUserBackend: Send + Sync + 'static { &mut self, device_event: u16, evset: epoll::Events, - vrings: &Vec>>, + vrings: &[Arc>], ) -> result::Result; /// Get virtio device configuration. @@ -625,7 +625,7 @@ impl VhostUserSlaveReqHandler for VhostUserHandler { self.vrings[index as usize].write().unwrap().queue.ready = false; if let Some(fd) = self.vrings[index as usize].read().unwrap().kick.as_ref() { self.worker - .unregister_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, index as u64) + .unregister_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, u64::from(index)) .map_err(VhostUserError::ReqHandlerError)?; } @@ -659,7 +659,7 @@ impl VhostUserSlaveReqHandler for VhostUserHandler { self.vrings[index as usize].write().unwrap().queue.ready = true; if let Some(fd) = self.vrings[index as usize].read().unwrap().kick.as_ref() { self.worker - .register_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, index as u64) + .register_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, u64::from(index)) .map_err(VhostUserError::ReqHandlerError)?; }