From ab57a70665a599a73102582ceae3557db275ae12 Mon Sep 17 00:00:00 2001 From: Akhi Singhania Date: Mon, 5 Sep 2022 18:11:20 +0200 Subject: [PATCH] refactor: use a simple if instead of match + if --- runtime/runtime-params-estimator/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/runtime/runtime-params-estimator/src/lib.rs b/runtime/runtime-params-estimator/src/lib.rs index 1db2fe91adf..a39fb41787f 100644 --- a/runtime/runtime-params-estimator/src/lib.rs +++ b/runtime/runtime-params-estimator/src/lib.rs @@ -225,12 +225,10 @@ pub fn run(config: Config) -> CostTable { let mut res = CostTable::default(); for (cost, f) in ALL_COSTS.iter().copied() { - let skip = match &ctx.config.costs_to_measure { - None => false, - Some(costs) => !costs.contains(&format!("{:?}", cost)), - }; - if skip { - continue; + if let Some(costs) = &ctx.config.costs_to_measure { + if !costs.contains(&format!("{:?}", cost)) { + continue; + } } let start = Instant::now();