diff --git a/src/math_app.rs b/src/math_app.rs index a7dd526..18125c0 100644 --- a/src/math_app.rs +++ b/src/math_app.rs @@ -1,7 +1,7 @@ use crate::consts::*; use crate::function_entry::Riemann; use crate::function_manager::Manager; -use crate::misc::{dyn_mut_iter, option_vec_printer, JsonFileOutput, SerdeValueHelper}; +use crate::misc::{dyn_mut_iter, option_vec_printer, SerdeValueHelper, TextData}; use egui::style::Margin; use egui::Frame; use egui::{ @@ -113,7 +113,8 @@ pub struct MathApp { /// Stores opened windows/elements for later reference opened: Opened, - text: JsonFileOutput, + /// Stores loaded text data from `test.json` + text: TextData, /// Stores settings (pretty self-explanatory) settings: AppSettings, @@ -157,7 +158,7 @@ impl MathApp { let mut font_emoji_icon: Option = None; // Stores text - let mut text_data: Option = None; + let mut text_data: Option = None; tracing::info!("Reading assets..."); // Iterate through all entries in the tarball diff --git a/src/misc.rs b/src/misc.rs index a5e5d2f..4a127b8 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -182,7 +182,7 @@ impl EguiHelper for Vec { } #[derive(PartialEq, Debug)] -pub struct JsonFileOutput { +pub struct TextData { pub help_expr: String, pub help_vars: String, pub help_panel: String, @@ -220,8 +220,8 @@ impl SerdeValueHelper { fn parse_singleline(&self, key: &str) -> String { self.value[key].as_str().unwrap().to_owned() } /// Used to parse `text.json` - pub fn parse_values(&self) -> JsonFileOutput { - JsonFileOutput { + pub fn parse_values(&self) -> TextData { + TextData { help_expr: self.parse_multiline("help_expr"), help_vars: self.parse_multiline("help_vars"), help_panel: self.parse_multiline("help_panel"),