From 9442110f985e1479f19d200e5c8bb4bd5cd83c28 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Tue, 3 Sep 2024 10:19:30 +0200 Subject: [PATCH] vhost: fix clippy deprecating `feature = "cargo-clippy"` The latest toolchain update in rust-vmm-ci caused the following error: error: unexpected `cfg` condition value: `cargo-clippy` --> vhost/src/vhost_user/message.rs:758:16 | 758 | #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_conversion))] | ^^^^^^^^^^^^^^^^^^^^^^^^ | As suggested in [1], today is no longer needed to check the `cargo-clippy` feature (which has been deprecated), but we can just use `#[allow(clippy::lint_name)]`. [1] https://blog.rust-lang.org/2024/02/28/Clippy-deprecating-feature-cargo-clippy.html Signed-off-by: Stefano Garzarella --- vhost/src/vhost_user/connection.rs | 2 +- vhost/src/vhost_user/message.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vhost/src/vhost_user/connection.rs b/vhost/src/vhost_user/connection.rs index 65fb231..a1d9633 100644 --- a/vhost/src/vhost_user/connection.rs +++ b/vhost/src/vhost_user/connection.rs @@ -550,7 +550,7 @@ impl Endpoint { /// * - SocketError: other socket related errors. /// * - PartialMessage: received a partial message. /// * - InvalidMessage: received a invalid message. - #[cfg_attr(feature = "cargo-clippy", allow(clippy::type_complexity))] + #[allow(clippy::type_complexity)] pub fn recv_payload_into_buf( &mut self, buf: &mut [u8], diff --git a/vhost/src/vhost_user/message.rs b/vhost/src/vhost_user/message.rs index 68333af..c66bd44 100644 --- a/vhost/src/vhost_user/message.rs +++ b/vhost/src/vhost_user/message.rs @@ -755,7 +755,7 @@ impl VhostUserVringAddr { } /// Create a new instance from `VringConfigData`. - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_conversion))] + #[allow(clippy::useless_conversion)] pub fn from_config_data(index: u32, config_data: &VringConfigData) -> Self { let log_addr = config_data.log_addr.unwrap_or(0); VhostUserVringAddr {