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 <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-03-15 02:48:05 -07:00
parent c14fd5c575
commit b92ab6e4b1

View File

@@ -3485,7 +3485,7 @@ mod common_parallel {
fn get_image_info(path: &std::path::Path) -> Option<serde_json::Value> {
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()
}