Skip to content

Commit 1d65c4a

Browse files
committed
Updated db to account for new Streak fields
1 parent d3a6fcd commit 1d65c4a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/db.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fs::{File, OpenOptions};
33
use std::io::Write;
44
use std::sync::{Arc, Mutex};
55

6+
use serde::{Deserialize, Serialize};
67
use uuid::Uuid;
78

89
use crate::streak::Streak;
@@ -241,8 +242,14 @@ mod tests {
241242
db.save().unwrap();
242243

243244
let expected_content = format!(
244-
r#"{{"{}":(id:"{}",task:"{}",frequency:Daily,last_checkin:{:?},total_checkins:{})}}"#,
245-
streak.id, streak.id, streak.task, streak.last_checkin, streak.total_checkins
245+
r#"{{"{}":(id:"{}",task:"{}",frequency:Daily,last_checkin:{:?},current_streak:{},longest_streak:{},total_checkins:{})}}"#,
246+
streak.id,
247+
streak.id,
248+
streak.task,
249+
streak.last_checkin,
250+
streak.current_streak,
251+
streak.longest_streak,
252+
streak.total_checkins
246253
);
247254

248255
let result = std::fs::read_to_string(file_path);

0 commit comments

Comments
 (0)