From 03e7105ee9724d282b94b771b76698052d325e9f Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 26 Apr 2022 09:11:59 -0400 Subject: [PATCH] JsonFileOutput -> TextData --- src/math_app.rs | 7 ++++--- src/misc.rs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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"),