diff --git a/src/main.rs b/src/main.rs index 1d56925..ae02115 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,17 +32,24 @@ fn main() { let fahrenheit_icon = Icons::Fahrenheit.get_icon_str(); // Build the rows for the table. let mut table_rows: Vec = vec![]; + let mut game_flag = false; for i in 0..entire_forecast.len() { let forecast_period = &entire_forecast[i]; let yyyy_mm_dd = &forecast_period.start_time[0..10]; let mut sox_status = String::new(); // Check if there is a sox game and print opp. - for sox_game in &sox_games { - if sox_game.date == yyyy_mm_dd { - sox_status = format!("{} {}\n{} {}", &baseball_icon, &sox_game.opponent, &clock_icon, &sox_game.start_time); - break; + if game_flag == false { + for sox_game in &sox_games { + if sox_game.date == yyyy_mm_dd { + sox_status = format!("{} {}\n{} {}", &baseball_icon, &sox_game.opponent, &clock_icon, &sox_game.start_time); + game_flag = true; + break; + } } } + else { + game_flag = false; + } let row = TableRow { date: yyyy_mm_dd.to_string(), time_of_day: forecast_period.name.clone(),