diff options
author | Joris | 2022-02-13 09:30:42 +0100 |
---|---|---|
committer | Joris | 2022-02-13 09:30:42 +0100 |
commit | 8170fb5e432cc81986479a6a3a400e009426d76a (patch) | |
tree | 18fe059613547024212aa1f192d83c6df1543fa4 /src/gui | |
parent | c001d6ec59221b11af8e7aafce76002cc63604e6 (diff) |
Properly shuffle card presentation from card insertion
Instead of messing with deck_read, subtracting a random amount of
seconds to it, pick a random card instead of the first ready.
This permits to remove the dependency to the rand crate.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/gui.rs b/src/gui/gui.rs index 94e15d8..2f41a0b 100644 --- a/src/gui/gui.rs +++ b/src/gui/gui.rs @@ -20,7 +20,7 @@ pub fn start(conn: &Connection, deck_name: &String) -> Result<()> { let now = time::now()?; let title = title(deck_name, answers, db::count_available(&conn).unwrap_or(0)); - match db::next_ready(&conn) { + match db::pick_random_ready(&conn) { Some(card) if card.ready <= now => { let difficulty = question::ask(&mut terminal, &events, &title, &card)?; answers += 1; |