diff --git a/src/wal/redb.rs b/src/wal/redb.rs index 09f78b22..e7da3560 100644 --- a/src/wal/redb.rs +++ b/src/wal/redb.rs @@ -249,8 +249,8 @@ impl WalStore { } }; - let delta = last_slot - start_slot; - let excess = delta - max_slots; + let delta = last_slot.saturating_sub(start_slot); + let excess = delta.saturating_sub(max_slots); debug!( delta,