From 972b045b21a77f1c6047435f09f86b98bacbc8fd Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Tue, 20 Jun 2023 23:58:25 -0400 Subject: [PATCH] Rename the new_time function --- status/src/solar_client.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/status/src/solar_client.rs b/status/src/solar_client.rs index 8e38023..0aa7d5c 100644 --- a/status/src/solar_client.rs +++ b/status/src/solar_client.rs @@ -20,16 +20,16 @@ pub struct SunMoon { impl SunMoon { fn from_js(day: Date, val: SunMoonJs) -> Self { - fn kreu_tempo(day: Date, val: String) -> Option> { + fn new_time(day: Date, val: String) -> Option> { NaiveTime::parse_from_str(&val, "%H:%M") .map(|tempo| day.and_hms(tempo.hour(), tempo.minute(), 0)) .ok() } - let sunrise = kreu_tempo(day.clone(), val.sunrise).unwrap(); - let sunset = kreu_tempo(day.clone(), val.sunset).unwrap(); - let moonrise = val.moonrise.and_then(|v| kreu_tempo(day.clone(), v)); - let moonset = val.moonset.and_then(|v| kreu_tempo(day.clone(), v)); + let sunrise = new_time(day.clone(), val.sunrise).unwrap(); + let sunset = new_time(day.clone(), val.sunset).unwrap(); + let moonrise = val.moonrise.and_then(|v| new_time(day.clone(), v)); + let moonset = val.moonset.and_then(|v| new_time(day.clone(), v)); Self { sunrise,