app_async: fix print random question

This commit is contained in:
2023-08-25 14:41:53 +03:00
parent 760f6d9415
commit 9c5f05b6a9

View File

@@ -154,7 +154,7 @@ async fn read_from_db(id: u32) -> Option<Question> {
let len = reader.len();
let index = if len == 0 {
let index = if id == 0 {
let mut rng = thread_rng();
let questions = Uniform::new(0, len);
rng.sample(questions)