Another type hehe.

This commit is contained in:
calcu1on 2025-04-06 09:36:38 -04:00
parent c3b36f983e
commit a1270866a5
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#[allow(dead_code)] #[allow(dead_code)]
pub enum Icons { pub enum Icons {
Fahrenheight, Fahrenheit,
Clock, Clock,
Baseball, Baseball,
Sunny, Sunny,
@ -15,7 +15,7 @@ impl Icons {
pub fn get_icon_str(&self) -> String { pub fn get_icon_str(&self) -> String {
match self { match self {
Icons::Fahrenheight => Self::get_icon("e341").unwrap().to_string(), Icons::Fahrenheit => Self::get_icon("e341").unwrap().to_string(),
Icons::Clock => Self::get_icon("e641").unwrap().to_string(), Icons::Clock => Self::get_icon("e641").unwrap().to_string(),
Icons::Baseball => Self::get_icon("f0852").unwrap().to_string(), Icons::Baseball => Self::get_icon("f0852").unwrap().to_string(),
Icons::Sunny => Self::get_icon("f0599").unwrap().to_string(), Icons::Sunny => Self::get_icon("f0599").unwrap().to_string(),

View File

@ -29,7 +29,7 @@ fn main() {
// Build icons. // Build icons.
let baseball_icon = Icons::Baseball.get_icon_str(); let baseball_icon = Icons::Baseball.get_icon_str();
let clock_icon = Icons::Clock.get_icon_str(); let clock_icon = Icons::Clock.get_icon_str();
let fahrenheight_icon = Icons::Fahrenheight.get_icon_str(); let fahrenheit_icon = Icons::Fahrenheit.get_icon_str();
// Build the rows for the table. // Build the rows for the table.
let mut table_rows: Vec<TableRow> = vec![]; let mut table_rows: Vec<TableRow> = vec![];
for i in 0..entire_forecast.len() { for i in 0..entire_forecast.len() {
@ -46,7 +46,7 @@ fn main() {
let row = TableRow { let row = TableRow {
date: yyyy_mm_dd.to_string(), date: yyyy_mm_dd.to_string(),
time_of_day: forecast_period.name.clone(), time_of_day: forecast_period.name.clone(),
temp: format!("{}{}", forecast_period.temperature, fahrenheight_icon), temp: format!("{}{}", forecast_period.temperature, fahrenheit_icon),
red_sox: sox_status, red_sox: sox_status,
forecast: forecast_period.detailed_forecast.to_string(), forecast: forecast_period.detailed_forecast.to_string(),
}; };