From b92ab6e4b10e92408f97fd557931e02f97747cfc Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sun, 15 Mar 2026 02:48:05 -0700 Subject: [PATCH] tests: Fix clippy issue related to unnecessary closure error: unnecessary closure used with `bool::then` --> cloud-hypervisor/tests/integration.rs:3488:9 | 3488 | output.status.success().then(|| ())?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations = note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D clippy::all` = help: to override `-D clippy::all` add `#[allow(clippy::unnecessary_lazy_evaluations)]` help: use `then_some` instead | 3488 - output.status.success().then(|| ())?; 3488 + output.status.success().then_some(())?; | Signed-off-by: Rob Bradford --- cloud-hypervisor/tests/integration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index 53fcbc17c..25dde15c0 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -3485,7 +3485,7 @@ mod common_parallel { fn get_image_info(path: &std::path::Path) -> Option { let output = run_qemu_img(path, &["info", "-U", "--output=json"], None); - output.status.success().then(|| ())?; + output.status.success().then_some(())?; serde_json::from_slice(&output.stdout).ok() }