aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJoris2025-02-07 11:23:57 +0100
committerJoris2025-02-07 11:23:57 +0100
commit49c924415e98e78b2ea5a18e0d2777a571fb3ac9 (patch)
tree43dec83a147133dbae44fd4a82d6a170fe8a5a84 /src/gui
parent924b10b0cd6c09fa7afa58e6f7a068646d1e56af (diff)
Move db cards to specific function
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/mod.rs b/src/gui/mod.rs
index 3abe238..d721b90 100644
--- a/src/gui/mod.rs
+++ b/src/gui/mod.rs
@@ -47,15 +47,15 @@ pub fn start(
let title = title(
deck_name,
- db::count_available(conn).unwrap_or(0),
+ db::cards::count_available(conn).unwrap_or(0),
hide_remaining,
);
- match db::pick_random_ready(conn) {
+ match db::cards::pick_random_ready(conn) {
Some(card) => match question::ask(term, &title, &card)? {
question::Response::Aborted => break,
question::Response::Answered { difficulty } => {
- db::update(
+ db::cards::update(
conn,
&card.question,
&space_repetition::update(card.state, difficulty),
@@ -63,7 +63,7 @@ pub fn start(
}
},
None => {
- let message = match db::next_ready(conn) {
+ let message = match db::cards::next_ready(conn) {
Some(ready) => {
let now = time::seconds_since_unix_epoch()?;
let duration = time::pp_duration(ready - now);