From f2011ac987505a89f4a7f6cade97d3d2e9c65522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Thu, 7 Dec 2023 13:19:17 +0100 Subject: [PATCH] Fix: substracting with overflow --- src/history/file_backed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/history/file_backed.rs b/src/history/file_backed.rs index d9a7de75..6b11f9e3 100644 --- a/src/history/file_backed.rs +++ b/src/history/file_backed.rs @@ -52,7 +52,7 @@ fn decode_entry(s: &str) -> String { impl History for FileBackedHistory { fn generate_id(&mut self) -> HistoryItemId { - HistoryItemId((self.entries.len() - 1) as i64) + HistoryItemId((self.entries.len() + 1) as i64) } /// only saves a value if it's different than the last value