From ceff1ed98de5150df1710c2264b16cff4debc1a8 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Mon, 9 Jun 2025 03:37:56 +0000 Subject: [PATCH] dragonball: Fix clippy `needless_lifetimes` Fix `needless_lifetimes` clippy warning as suggested by rust 1.85.1. ```console error: the following explicit lifetimes could be elided: 'a --> dbs_virtio_devices/src/vhost/vhost_user/connection.rs:137:6 | 137 | impl<'a, AS: GuestAddressSpace, Q: QueueT, R: GuestMemoryRegion> EndpointParam<'a, AS, Q, R> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `-D clippy::needless-lifetimes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]` help: elide the lifetimes | 137 - impl<'a, AS: GuestAddressSpace, Q: QueueT, R: GuestMemoryRegion> EndpointParam<'a, AS, Q, R> { 137 + impl EndpointParam<'_, AS, Q, R> { | ``` Signed-off-by: Ruoqing He --- .../dbs_virtio_devices/src/vhost/vhost_user/connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dragonball/dbs_virtio_devices/src/vhost/vhost_user/connection.rs b/src/dragonball/dbs_virtio_devices/src/vhost/vhost_user/connection.rs index a5738a0011..1c9fe29c19 100644 --- a/src/dragonball/dbs_virtio_devices/src/vhost/vhost_user/connection.rs +++ b/src/dragonball/dbs_virtio_devices/src/vhost/vhost_user/connection.rs @@ -134,7 +134,7 @@ pub(super) struct EndpointParam<'a, AS: GuestAddressSpace, Q: QueueT, R: GuestMe pub slave_req_fd: Option, } -impl<'a, AS: GuestAddressSpace, Q: QueueT, R: GuestMemoryRegion> EndpointParam<'a, AS, Q, R> { +impl EndpointParam<'_, AS, Q, R> { fn get_host_address(&self, addr: GuestAddress, mem: &AS::M) -> VirtioResult<*mut u8> { mem.get_host_address(addr) .map_err(|_| VirtioError::InvalidGuestAddress(addr))