Skip to content

Commit 35638fd

Browse files
committed
Addressing clippy
1 parent 97222c4 commit 35638fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

token-lending/sdk/src/state/liquidity_mining.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ mod tests {
291291
if neither_has_ended && claimed_foo != claimed_bar {
292292
// due to rounding errors we can be a little off
293293
let allowed_diff = 1;
294-
let allowed_min =
295-
claimed_foo.checked_sub(allowed_diff).unwrap_or(0);
294+
let allowed_min = claimed_foo.saturating_sub(allowed_diff);
296295
let allowed_range = allowed_min..=(claimed_foo + allowed_diff);
297296
prop_assert!(
298297
allowed_range.contains(&claimed_bar),
@@ -326,7 +325,7 @@ mod tests {
326325

327326
// User's claimed no more than total_rewards and not much less either.
328327
// Due to rounding issues we're ok with distributing one less token per user.
329-
let max_allowed_diff = 1 * user_count as u64;
328+
let max_allowed_diff = user_count as u64;
330329

331330
let foo_allowed_range = (total_rewards - max_allowed_diff)..=total_rewards;
332331
prop_assert!(

0 commit comments

Comments
 (0)