From 0af899f3d6eb872cfb7b0061117c94a0c9a898cc Mon Sep 17 00:00:00 2001 From: brooks Date: Wed, 27 Dec 2023 16:06:03 -0600 Subject: [PATCH 1/2] clippy: Updates name for blocks_in_conditions --- runtime/src/bank.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 0329ca81b7ec6c..fc88369f601756 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -7973,7 +7973,7 @@ impl Bank { } } for precompile in get_precompiles() { - #[allow(clippy::blocks_in_if_conditions)] + #[allow(clippy::blocks_in_conditions)] if precompile.feature.map_or(false, |ref feature_id| { self.feature_set.is_active(feature_id) }) { From c9142e1984fe73a2ee6f5d7c763d55dbcca4dfd9 Mon Sep 17 00:00:00 2001 From: brooks Date: Wed, 27 Dec 2023 16:25:11 -0600 Subject: [PATCH 2/2] Replace clippy allow with a let --- runtime/src/bank.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index fc88369f601756..2213f9fdab105c 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -7973,10 +7973,12 @@ impl Bank { } } for precompile in get_precompiles() { - #[allow(clippy::blocks_in_conditions)] - if precompile.feature.map_or(false, |ref feature_id| { - self.feature_set.is_active(feature_id) - }) { + let should_add_precompile = precompile + .feature + .as_ref() + .map(|feature_id| self.feature_set.is_active(feature_id)) + .unwrap_or(false); + if should_add_precompile { self.add_precompile(&precompile.program_id); } }