type annotated instead of turbofish

This commit is contained in:
Wyatt J. Miller 2024-08-02 15:44:02 -04:00
parent ee442f9309
commit 1c5baebd27

View File

@ -10,12 +10,12 @@ fn main() {
let teams_json: Value = serde_json::from_reader(reader).expect("Unable to parse JSON"); let teams_json: Value = serde_json::from_reader(reader).expect("Unable to parse JSON");
let team_names_list = teams_json["team_names"].as_array().unwrap(); let team_names_list = teams_json["team_names"].as_array().unwrap();
let team_colors = teams_json["team_colors"] let team_colors: Vec<&str> = teams_json["team_colors"]
.as_array() .as_array()
.unwrap() .unwrap()
.iter() .iter()
.filter_map(|color| color.as_str()) .filter_map(|color| color.as_str())
.collect::<Vec<&str>>(); .collect();
let mut selected_colors = HashSet::new(); let mut selected_colors = HashSet::new();
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();