From 0e305e7cecd697a7befe26298abc90bef0fac483 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 29 Aug 2024 17:59:10 -0700 Subject: include a weather data json in lib --- src/eorzean_weather.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/eorzean_weather.rs b/src/eorzean_weather.rs index 3badd0f..a462627 100644 --- a/src/eorzean_weather.rs +++ b/src/eorzean_weather.rs @@ -175,7 +175,7 @@ pub fn calculate_weather_forecast_target(current_time: T) -> /// - 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"); + let weather_data = include_str!("../data/weather_data.json"); let weather_data: serde_json::Value = serde_json::from_str(&weather_data).expect("Unable to parse the weather data"); let zone_data = weather_data .get(zone_name) -- cgit v1.2.3