From 28385eb2fa928c0bf99f7ac3c95ebf5a37593008 Mon Sep 17 00:00:00 2001 From: aner-starkware <147302140+aner-starkware@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:55:51 +0300 Subject: [PATCH] refactor(starknet_api): compiler refactor recommendation (#1288) --- crates/starknet_api/src/transaction.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/starknet_api/src/transaction.rs b/crates/starknet_api/src/transaction.rs index edb343cd58..a3d3e28e0b 100644 --- a/crates/starknet_api/src/transaction.rs +++ b/crates/starknet_api/src/transaction.rs @@ -751,14 +751,9 @@ impl Fee { } pub fn checked_div_ceil(self, rhs: NonzeroGasPrice) -> Option { - match self.checked_div(rhs) { - Some(value) => Some(if value.nonzero_saturating_mul(rhs) < self { - (value.0 + 1).into() - } else { - value - }), - None => None, - } + self.checked_div(rhs).map(|value| { + if value.nonzero_saturating_mul(rhs) < self { (value.0 + 1).into() } else { value } + }) } pub fn checked_div(self, rhs: NonzeroGasPrice) -> Option {