From a27bb218024b3926b8f700b89ff3104827282bf0 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 26 Aug 2024 23:24:48 -0700 Subject: add docstring for weather_by_time func --- src/eorzean_weather.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/eorzean_weather.rs b/src/eorzean_weather.rs index 8f79f96..3badd0f 100644 --- a/src/eorzean_weather.rs +++ b/src/eorzean_weather.rs @@ -166,6 +166,13 @@ pub fn calculate_weather_forecast_target(current_time: T) -> (step2 % 100) as i32 } +/// Gets the weather for a given zone at a given time +/// +/// # Arguments +/// - `zone_name` - The name of the zone to calculate the forecast for +/// +/// # Returns +/// - A Weather struct representing the current weather pub fn get_weather_by_time(zone_name: &str, current_time: T) -> Weather { // Load the weather data from the JSON file let weather_data = fs::read_to_string("data/weather_data.json").expect("Unable to read the weather data file"); @@ -201,6 +208,7 @@ pub fn get_weather_by_time(zone_name: &str, current_time: T) } /// Calculates the weather forecast for a given zone at a given time +/// Setting interval_offset to 0 will calculate the weather at the given time, as well as the start and end times of the interval /// /// # Arguments /// - `zone_name` - The name of the zone to calculate the forecast for -- cgit v1.2.3