From 68ac8762f1c0539aa36071d3df13cf1ad5358234 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Tue, 28 May 2024 12:52:37 -0700 Subject: [PATCH] fix `clippy::redundant_closure_call` warning The `diff_row!` macro in `blueprint_diff.rs` has recently started generating [`clippy::redundant_closure_call`][1] warnings, as invocations without a `display` function pass in a closure that performs an identity operation (e.g. just returns the value). Rather than allowing the warning, which would also have been fine, I've changed this arm of the macro to pass the named function `std::convert::identity` instead, which is equivalent but eliminates the closure. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call --- nexus/types/src/deployment/blueprint_diff.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus/types/src/deployment/blueprint_diff.rs b/nexus/types/src/deployment/blueprint_diff.rs index 0ee039b50f..17631e692d 100644 --- a/nexus/types/src/deployment/blueprint_diff.rs +++ b/nexus/types/src/deployment/blueprint_diff.rs @@ -667,7 +667,7 @@ impl<'diff> BlueprintDiffDisplay<'diff> { ) -> impl IntoIterator { macro_rules! diff_row { ($member:ident, $label:expr) => { - diff_row!($member, $label, |value| value) + diff_row!($member, $label, std::convert::identity) }; ($member:ident, $label:expr, $display:expr) => {