diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-08-29 17:59:10 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-08-29 18:22:47 -0700 |
| commit | 0e305e7cecd697a7befe26298abc90bef0fac483 (patch) | |
| tree | 9adcb309eebdf81f1d400929ad1ad245dba46b92 /src | |
| parent | b69d67de6e14b83647b4e4201cc2403b30d4df8a (diff) | |
include a weather data json in lib
Diffstat (limited to 'src')
| -rw-r--r-- | src/eorzean_weather.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<T: ToUnixTimestamp>(current_time: T) -> /// - A Weather struct representing the current weather pub fn get_weather_by_time<T: ToUnixTimestamp>(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) |
