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 --- Cargo.lock | 2 +- Cargo.toml | 3 ++- src/eorzean_weather.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d346a66..47825d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,7 +66,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "ffxiv-chronowatcher" -version = "0.0.3" +version = "0.0.32" dependencies = [ "chrono", "serde", diff --git a/Cargo.toml b/Cargo.toml index c16fafa..a516a34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,12 @@ description = "Weather and Eorzean Time Library for Final Fantasy XIV" repository = "https://github.com/pinapelz/ffxiv-chronowatcher" readme = "README.md" keywords = ["ffxiv", "eorzea", "weather", "time"] -version = "0.0.3" +version = "0.0.32" edition = "2021" exclude = [ "src/main.rs", ] + license = "MIT" [dependencies] 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