From df2516f229afd5ad93b09484fb72c35394ad20c1 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 27 Sep 2019 15:16:11 +0100 Subject: [PATCH] vhost_rs: Add clippy override clippy wants us to use "if let Some(fd) = fd {}" but to combine that with && is an experimental feature. Signed-off-by: Rob Bradford --- vhost_rs/src/vhost_user/master.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vhost_rs/src/vhost_user/master.rs b/vhost_rs/src/vhost_user/master.rs index 129034630..ef2eadf4e 100644 --- a/vhost_rs/src/vhost_user/master.rs +++ b/vhost_rs/src/vhost_user/master.rs @@ -167,9 +167,12 @@ impl VhostBackend for Master { node.wait_for_ack(&hdr).map_err(|e| e.into()) } + // Clippy doesn't seem to know that if let with && is still experimental + #[allow(clippy::unnecessary_unwrap)] fn set_log_base(&mut self, base: u64, fd: Option) -> Result<()> { let mut node = self.node.lock().unwrap(); let val = VhostUserU64::new(base); + if node.acked_protocol_features & VhostUserProtocolFeatures::LOG_SHMFD.bits() != 0 && fd.is_some() {