Closed gangov closed 7 months ago
if we do something like
let mut share_ratio = Decimal::zero(); let total_shares = utils::get_total_shares(&env); if total_shares != 0i128 { share_ratio = Decimal::from_ratio(share_amount, total_shares); } else { panic_with_err!(..) }
then this makes the assignment of Decimal::zero(); to share_ratio conflict with the compiler.
Decimal::zero();
share_ratio
Using two separate if statements seems too much for me, so that's why I go with this in the PR
if we do something like
then this makes the assignment of
Decimal::zero();
toshare_ratio
conflict with the compiler.Using two separate if statements seems too much for me, so that's why I go with this in the PR