From 5caeac530eec7279e330ffe45a0572f6a357fd39 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Sat, 26 Oct 2024 17:36:27 +0800 Subject: [PATCH] Update to FSRS-rs v1.3.5 (FSRS-5 model update) && keep three decimals for stability (#3520) * Update to FSRS-rs v1.3.5 (FSRS-5 model update) * keep three decimals for stability fix https://forums.ankiweb.net/t/fsrs-5-1d-scheduling-and-learning-steps/50242/122?u=l.m.sherlock --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- cargo/licenses.json | 2 +- rslib/src/storage/card/data.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1385d889c..2393ff6f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,9 +1860,9 @@ dependencies = [ [[package]] name = "fsrs" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05b1fdbaa34f9bcd605ad50477eea51b27b3f60f973021bd9ee1b5943169150" +checksum = "42155527199b3e7b6ad47e9db849ee25bd5bd436ee17a72ae0a3de646a20021a" dependencies = [ "burn", "itertools 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 4af2c46d1..c3d6241f1 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.3.4" +version = "=1.3.5" # git = "https://github.com/open-spaced-repetition/fsrs-rs.git" # rev = "58ca25ed2bc4bb1dc376208bbcaed7f5a501b941" # path = "../open-spaced-repetition/fsrs-rs" diff --git a/cargo/licenses.json b/cargo/licenses.json index de342bec6..cbbede5ca 100644 --- a/cargo/licenses.json +++ b/cargo/licenses.json @@ -1225,7 +1225,7 @@ }, { "name": "fsrs", - "version": "1.3.4", + "version": "1.3.5", "authors": "Open Spaced Repetition", "repository": "https://github.com/open-spaced-repetition/fsrs-rs", "license": "BSD-3-Clause", diff --git a/rslib/src/storage/card/data.rs b/rslib/src/storage/card/data.rs index bbce38bb6..ea529c495 100644 --- a/rslib/src/storage/card/data.rs +++ b/rslib/src/storage/card/data.rs @@ -79,7 +79,7 @@ impl CardData { pub(crate) fn convert_to_json(&mut self) -> Result { if let Some(v) = &mut self.fsrs_stability { - round_to_places(v, 2) + round_to_places(v, 3) } if let Some(v) = &mut self.fsrs_difficulty { round_to_places(v, 3) @@ -163,7 +163,7 @@ mod test { }; assert_eq!( data.convert_to_json().unwrap(), - r#"{"s":123.46,"d":1.235,"dr":0.99}"# + r#"{"s":123.457,"d":1.235,"dr":0.99}"# ); } }