Skip to content

Commit

Permalink
refactor(starknet_api): compiler refactor recommendation (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
aner-starkware authored Oct 10, 2024
1 parent 8fa8073 commit 28385eb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crates/starknet_api/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,9 @@ impl Fee {
}

pub fn checked_div_ceil(self, rhs: NonzeroGasPrice) -> Option<GasAmount> {
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<GasAmount> {
Expand Down

0 comments on commit 28385eb

Please sign in to comment.