From 52c04fd817392d6ec06b9d7dd11b7be1922e5b29 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Tue, 24 Dec 2024 18:26:50 +0800 Subject: [PATCH 1/3] Fix/last date of existing card should not be positive in simulation --- rslib/src/scheduler/fsrs/simulator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index 70a6d90012..d9fc2bafac 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -75,10 +75,11 @@ impl Card { CardQueue::DayLearn | CardQueue::Review => { let due = card.original_or_current_due(); let relative_due = due - days_elapsed; + let last_date = (relative_due - card.interval as i32).min(0) as f32; Some(fsrs::Card { difficulty: state.difficulty, stability: state.stability, - last_date: (relative_due - card.interval as i32) as f32, + last_date, due: relative_due as f32, }) } From 91ab83bd29a58d1637874f4a20ecc32e9ea1b6f2 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 25 Dec 2024 10:03:59 +0800 Subject: [PATCH 2/3] update fsrs-rs to v1.4.9 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7e43c53e0..789a8f31a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,9 +1860,9 @@ dependencies = [ [[package]] name = "fsrs" -version = "1.4.7" +version = "1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61218a50bf5c8da66b62be02f495c5d0b43de52ec37fae036a0e68d4539ff59d" +checksum = "a98432a03a213c1913372a40adb29132bec7dbd3562cd9c00cc440b477e5a904" dependencies = [ "burn", "itertools 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 3d6926043e..c11abc07ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ git = "https://github.com/ankitects/linkcheck.git" rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca" [workspace.dependencies.fsrs] -version = "=1.4.7" +version = "=1.4.9" # git = "https://github.com/open-spaced-repetition/fsrs-rs.git" # rev = "58ca25ed2bc4bb1dc376208bbcaed7f5a501b941" # path = "../open-spaced-repetition/fsrs-rs" From 33874971cc90ae92f9d334611997f44ea2ddbf65 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 25 Dec 2024 10:09:17 +0800 Subject: [PATCH 3/3] ./ninja fix:minilints --- cargo/licenses.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo/licenses.json b/cargo/licenses.json index 3d350ee2fa..b1ce26b98e 100644 --- a/cargo/licenses.json +++ b/cargo/licenses.json @@ -1225,7 +1225,7 @@ }, { "name": "fsrs", - "version": "1.4.7", + "version": "1.4.9", "authors": "Open Spaced Repetition", "repository": "https://github.com/open-spaced-repetition/fsrs-rs", "license": "BSD-3-Clause",