Fix selection of user's country

This commit is contained in:
Vecna 2024-04-30 01:48:53 -04:00
parent b6a80c9b7d
commit dbf7dfe929
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ impl User {
let submits_reports = num < state.prob_user_submits_reports;
// Probabilistically decide user's country
let num: f64 = rng.gen_range(0.0..1.0);
let mut num: f64 = rng.gen_range(0.0..1.0);
let cc = {
let mut cc = String::default();
for (country, prob) in &state.probs_user_in_country {
@ -58,7 +58,7 @@ impl User {
cc = country.to_string();
break;
} else {
prob -= num;
num -= prob;
}
}
cc