Skip to content

Commit

Permalink
fix: temp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Austionian committed Jan 15, 2025
1 parent 05c9b8b commit 82c0be3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/forecast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct Forecast {
pub probability_of_thunder: Vec<u8>,
pub quality: Option<Vec<String>>,
pub starting_at: String,
pub temperature: Vec<u8>,
pub temperature: Vec<i8>,
#[serde(skip_serializing)]
pub wave_direction: Vec<f64>,
pub wave_height: Vec<f64>,
Expand Down Expand Up @@ -335,7 +335,7 @@ impl TryFrom<serde_json::Value> for Forecast {
truncate_to_two_decimals(v)
})?;
let temperature = Self::try_from_value(properties, "temperature", &|v| {
convert_celsius_to_fahrenheit(v).parse::<u8>().unwrap()
convert_celsius_to_fahrenheit(v).parse::<i8>().unwrap()
})?;
let probability_of_precipitation =
Self::try_from_value(properties, "probabilityOfPrecipitation", &|v| v as u8)?;
Expand Down

0 comments on commit 82c0be3

Please sign in to comment.