From 8de88b5c7c41bc16a8f6979b69bbd94b7fb9b5cd Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 14 Jan 2026 10:06:22 +0100 Subject: Migrate from usize to isize for integers in models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SQLite3, like many other DBs (e.g. PostgreSQL), assumes by default an i64::MAX value. Hence, while in the application we are talking mainly in unsigned terms (which is what makes sense here), this is not realistic to what ends up happening on the DB side. Up until now this just worked behind the scenes because rustqlite did the heavy lifting via default trait implementations of usize which handled this translation for us. This default implementation for usize was dropped in 0.38.0 (see [1]). Even if it can be enabled back via the "fallible_uint" feature, it's more fair to stick to isize, as it's not much of a problem on our side, and it's more transparent in regards to what happens in the end in the DB. Last but not least, this commit also upgrades rustqlite to the latest 0.38.0, with the rest of the dependency tree. [1] https://github.com/rusqlite/rusqlite/issues/1722) Signed-off-by: Miquel Sabaté Solà --- crates/cli/src/run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/cli/src/run.rs') diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs index 5d121d2..0084a6c 100644 --- a/crates/cli/src/run.rs +++ b/crates/cli/src/run.rs @@ -50,7 +50,7 @@ fn run_words(words: Vec, locale: &Locale) -> i32 { let found = !answer.is_empty() && tr.split(',').any(|tr| tr.trim().contains(answer)); if found { - if word.steps == MAX_STEPS - 1 { + if word.steps as usize == MAX_STEPS - 1 { let _ = update_success(&word, word.succeeded + 1, 0); } else { let _ = update_success(&word, word.succeeded, word.steps + 1); -- cgit v1.2.3