diff --git a/src/main.rs b/src/main.rs index 5607a8d..ee52313 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,12 +6,12 @@ use std::io::BufReader; fn main() { let file = File::open("team_names.json").expect("Unable to open JSON"); let reader = BufReader::new(file); - let v: Value = serde_json::from_reader(reader).expect("Unable to parse JSON"); + let team_names_json: Value = serde_json::from_reader(reader).expect("Unable to parse JSON"); - let team_names = v["team_names"].as_array().unwrap(); + let team_names_list = team_names_json["team_names"].as_array().unwrap(); let mut rng = rand::thread_rng(); - if let Some(chosen_name) = team_names.choose(&mut rng) { + if let Some(chosen_name) = team_names_list.choose(&mut rng) { println!("Randomly chosen team name: {}", chosen_name); } else { println!("No team names available");