Compare commits
2 Commits
069a6e22fe
...
cb5bd7a628
Author | SHA1 | Date |
---|---|---|
Dmitry Belyaev | cb5bd7a628 | |
Dmitry Belyaev | 9c5f05b6a9 |
|
@ -154,7 +154,7 @@ async fn read_from_db(id: u32) -> Option<Question> {
|
||||||
|
|
||||||
let len = reader.len();
|
let len = reader.len();
|
||||||
|
|
||||||
let index = if len == 0 {
|
let index = if id == 0 {
|
||||||
let mut rng = thread_rng();
|
let mut rng = thread_rng();
|
||||||
let questions = Uniform::new(0, len);
|
let questions = Uniform::new(0, len);
|
||||||
rng.sample(questions)
|
rng.sample(questions)
|
||||||
|
|
Loading…
Reference in New Issue