diff options
| author | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-10-14 07:34:45 +0200 |
|---|---|---|
| committer | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-10-14 07:34:45 +0200 |
| commit | f356030ecb84a925848f59912cf880ff293b9286 (patch) | |
| tree | 61a4bf0e4356c6e10ed92b152adb31fb9743379e /rust/src/web.rs | |
| parent | d32a31646c2e2357e94b22b3e6c1e2aab035d5c4 (diff) | |
| download | lambda-nantes-f356030ecb84a925848f59912cf880ff293b9286.tar.gz | |
Use more idiomatic saturating_add
Diffstat (limited to 'rust/src/web.rs')
| -rw-r--r-- | rust/src/web.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/rust/src/web.rs b/rust/src/web.rs index 5be1cfe..7e03249 100644 --- a/rust/src/web.rs +++ b/rust/src/web.rs @@ -146,9 +146,7 @@ impl Client { .collect::<Vec<_>>() .join("\n"); if actual == *expected { - if self.grade < u8::MAX { - self.grade += 1; - } + self.grade = self.grade.saturating_add(1); self.delay = Duration::from_secs_f64(self.delay.as_secs_f64() * 0.8); if self.delay.as_millis() < 500 { self.delay = Duration::from_millis(500); |
