From 9c5f05b6a99a94abcae7ea765f0798063cc54598 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 25 Aug 2023 14:41:53 +0300 Subject: [PATCH] app_async: fix print random question --- app_async/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_async/src/main.rs b/app_async/src/main.rs index 88e1256..6b21fb8 100644 --- a/app_async/src/main.rs +++ b/app_async/src/main.rs @@ -154,7 +154,7 @@ async fn read_from_db(id: u32) -> Option { 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)